setPreferredLocale method

Future<void> setPreferredLocale(
  1. Locale locale
)

Update preferred language of this

await guild.setPreferredLocale(Locale.fr);

Implementation

Future<void> setPreferredLocale (Locale locale) async {
  Response response = await ioc.use<DiscordApiHttpService>().patch(url: "/guilds/$id")
    .payload({ 'public_updates_channel_id': locale })
    .build();

  if (response.statusCode == 200) {
    _preferredLocale = locale as String;
  }
}