setPreferredLocale method

Future<void> setPreferredLocale(
  1. Locale locale
)

Update preferred language of this

Example :

import 'package:mineral/api.dart';

await guild.setPreferredLocale(Locale.fr); // 👈 Now you can use Lang enum

Implementation

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

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