setLabel method

Future<void> setLabel(
  1. String label, {
  2. String? reason,
})

Update the label of this

Example :

await webhook.setLabel('My webhook name');

Implementation

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

  if (response.statusCode == 200) {
    _label = label;
  }
}