1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-29 18:49:53 +03:00

Resync roles when restarting bot

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-01-24 12:36:53 +05:00
parent 9d5bafbbf5
commit b1e43611de
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
2 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,7 @@
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using Discord;
using Discord.WebSocket;
namespace Boyfriend.Data;
@ -86,6 +87,11 @@ public record GuildData {
MemberData.Remove(memberData.Id);
}
if (memberData.MutedUntil is null) {
memberData.Roles = ((IGuildUser)member).RoleIds.ToList();
memberData.Roles.Remove(guild.Id);
}
continue;
}