mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-10 16:03:15 +03:00
Add mute role support & fix /unmute (#109)
- Added support for `MuteRole`, now if you add any role to this setting, then try to mute a member, all his roles will be removed except for the one you set in this setting. - Fixed `/unmute`, that tried to set target's display name to unmute reason. --------- Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
This commit is contained in:
parent
b796b885a1
commit
1e8b7e5373
4 changed files with 172 additions and 16 deletions
|
@ -23,7 +23,11 @@ public class GuildMemberUpdateResponder : IResponder<IGuildMemberUpdate>
|
|||
public async Task<Result> RespondAsync(IGuildMemberUpdate gatewayEvent, CancellationToken ct = default)
|
||||
{
|
||||
var memberData = await _guildData.GetMemberData(gatewayEvent.GuildID, gatewayEvent.User.ID, ct);
|
||||
memberData.Roles = gatewayEvent.Roles.ToList().ConvertAll(r => r.Value);
|
||||
if (memberData.MutedUntil is null)
|
||||
{
|
||||
memberData.Roles = gatewayEvent.Roles.ToList().ConvertAll(r => r.Value);
|
||||
}
|
||||
|
||||
return Result.FromSuccess();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue