setDeaf method
Deafens or not a server member
Example :
final member = guild.members.cache.get('240561194958716924');
if (member != null) {
await member.setDeaf(true);
}
Implementation
Future<void> setDeaf(bool value) async {
final Response response = await ioc.use<DiscordApiHttpService>().patch(url: '/guilds/$_guildId/members/$_memberId')
.payload({'deaf': value})
.build();
if (response.statusCode == 204 || response.statusCode == 200) {
_isDeaf = value;
return;
}
ioc.use<ConsoleService>().error('Unable to ${value ? 'deaf' : 'undeaf'} user #$_memberId');
}