setSystemChannel method

Future<void> setSystemChannel(
  1. TextChannel channel
)

Update system channel of this

final TextChannel channel = guild.channels.cache.getOrFail('240561194958716924');
await guild.setSystemChannel(channel);

Implementation

Future<void> setSystemChannel (TextChannel channel) async {
  Response response = await ioc.use<DiscordApiHttpService>().patch(url: "/guilds/$id")
    .payload({ 'system_channel_id': channel.id })
    .build();

  if (response.statusCode == 200) {
    _systemChannelId = channel.id;
    systemChannel = channel;
  }
}