setChannel method

Future<void> setChannel(
  1. Snowflake channelId, {
  2. String? reason,
})

Update the avatar of this

Example :

await webhook.setChannel('xxxxxxx');

Implementation

Future<void> setChannel (Snowflake channelId, { String? reason }) async {
  Response response = await ioc.use<DiscordApiHttpService>().patch(url: "/webhooks/$id")
    .payload({ 'channel_id': channelId })
    .auditLog(reason)
    .build();

  if (response.statusCode == 200) {
    _channelId = channelId;
  }
}