setEnabled method

Future<void> setEnabled(
  1. bool value
)

Update enabled of this

Example :

await rule.setEnabled(true);

Implementation

Future<void> setEnabled(bool value) async {
  Http http = ioc.singleton(Service.http);
  Response response = await http.patch(url: "/guilds/$guildId/auto-moderation/rules/$id", payload: { 'value': value });

  if (response.statusCode == 200) {
    enabled = value;
  }
}