1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00

Do not grant starter role if member is muted

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-01-27 09:52:13 +05:00
parent 00f5fa0d8d
commit 8ca4b83b9c
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
2 changed files with 2 additions and 4 deletions

View file

@ -150,7 +150,7 @@ public static class Boyfriend {
var user = guild.GetUser(mData.Id); var user = guild.GetUser(mData.Id);
if (DateTimeOffset.Now >= mData.BannedUntil) _ = guild.RemoveBanAsync(mData.Id); if (DateTimeOffset.Now >= mData.BannedUntil) _ = guild.RemoveBanAsync(mData.Id);
if (!mData.IsInGuild) continue; if (!mData.IsInGuild) continue;
if (!mData.Roles.Contains(starterRoleId)) _ = user.AddRoleAsync(starterRoleId); if (!mData.Roles.Contains(starterRoleId) && mData.MutedUntil is null) _ = user.AddRoleAsync(starterRoleId);
if (DateTimeOffset.Now >= mData.MutedUntil) { if (DateTimeOffset.Now >= mData.MutedUntil) {
await Utils.UnmuteMemberAsync( await Utils.UnmuteMemberAsync(

View file

@ -88,7 +88,7 @@ public static class EventHandler {
"op ??" => message.ReplyAsync( "op ??" => message.ReplyAsync(
"некоторые пасхальные цитаты которые вы могли найти были легально взяты у <@573772175572729876>"), "некоторые пасхальные цитаты которые вы могли найти были легально взяты у <@573772175572729876>"),
"++++" => message.ReplyAsync("#"), "++++" => message.ReplyAsync("#"),
_ => new CommandProcessor(message).HandleCommandAsync() _ => new CommandProcessor(message).HandleCommandAsync()
}; };
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -129,8 +129,6 @@ public static class EventHandler {
? Messages.DefaultWelcomeMessage ? Messages.DefaultWelcomeMessage
: config["WelcomeMessage"], user.Mention, guild.Name)); : config["WelcomeMessage"], user.Mention, guild.Name));
if (config["StarterRole"] is not "0") await user.AddRoleAsync(ulong.Parse(config["StarterRole"]));
if (!data.MemberData.ContainsKey(user.Id)) data.MemberData.Add(user.Id, new MemberData(user)); if (!data.MemberData.ContainsKey(user.Id)) data.MemberData.Add(user.Id, new MemberData(user));
var memberData = data.MemberData[user.Id]; var memberData = data.MemberData[user.Id];
memberData.IsInGuild = true; memberData.IsInGuild = true;