setAfkChannel method

Future<void> setAfkChannel(
  1. VoiceChannel channel
)

Update the afk channel

Example :

final voiceChannel = guild.channels.cache.get('240561194958716924');

if (voiceChannel != null) {
  await guild.setAfkChannel(2);
}

Implementation

Future<void> setAfkChannel (VoiceChannel channel) async {
  Response response = await ioc.use<HttpService>().patch(url: "/guilds/$id", payload: { 'afk_channel_id': channel.id });

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