1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-04 04:56:30 +03:00

Do not allow setting reminders without specifying a valid TimeSpan

Fixes #19

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-02-02 21:37:12 +05:00
parent 8f9c71edf1
commit a97341f9a9
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
7 changed files with 39 additions and 15 deletions

View file

@ -150,12 +150,13 @@ public static class Boyfriend {
mentions.Clear();
}
_ = ulong.TryParse(config["StarterRole"], out var starterRoleId);
foreach (var mData in data.MemberData.Values) {
var user = guild.GetUser(mData.Id);
if (now >= mData.BannedUntil) _ = guild.RemoveBanAsync(mData.Id);
if (!mData.IsInGuild) continue;
if (!mData.Roles.Contains(starterRoleId) && mData.MutedUntil is null) _ = user.AddRoleAsync(starterRoleId);
if (mData.MutedUntil is null
&& ulong.TryParse(config["StarterRole"], out var starterRoleId)
&& !mData.Roles.Contains(starterRoleId)) _ = user.AddRoleAsync(starterRoleId);
if (now >= mData.MutedUntil) {
await Utils.UnmuteMemberAsync(