setRulesChannel method

Future<void> setRulesChannel(
  1. TextChannel channel
)

Update rules channel of this

Example :

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

if (channel != null) {
  await guild.setRulesChannel(channel);
}

Implementation

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

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