setUsername method

Future<void> setUsername(
  1. String name
)

Update the username of this

await member.setUsername('John Doe');

Implementation

Future<void> setUsername (String name) async {
  Response response = await ioc.use<DiscordApiHttpService>().patch(url: "/guilds/${guild.id}/members/${user.id}")
    .payload({ 'nick': name })
    .build();

  if (response.statusCode == 200) {
    _nickname = name;
  }
}