setLabel method

Future<void> setLabel(
  1. String label
)

Modifies the label of the role.

Example :

final Role? role = guild.roles.cache.get('240561194958716924');
if (role != null) {
  await role.setLabel('New label');
}

Implementation

Future<void> setLabel (String label) async {

  Response response = await ioc.use<HttpService>().patch(url: "/guilds/${manager.guild.id}/roles/$id", payload: { 'name': label });
  if (response.statusCode == 200) {
    _label = label;
  }
}