setMessageNotification method

Future<void> setMessageNotification(
  1. NotificationLevel level
)

Defines the notification level of this

await guild.setMessageNotification(NotificationLevel.onlyMentions);

Implementation

Future<void> setMessageNotification (NotificationLevel level) async {
  Response response = await ioc.use<DiscordApiHttpService>().patch(url: "/guilds/$id")
    .payload({ 'default_message_notifications': level.value })
    .build();

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