setRulesChannel method

Future<void> setRulesChannel(
  1. TextChannel channel
)

Update rules channel of this

final TextChannel channel = guild.channels.cache.getOrFail('240561194958716924');
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;
  }
}