forked from TeamInklings/Octobot
Fixed a memory leak caused by hitting rate limits, caused by attempts to add unset starter roles
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
05ce680373
commit
41958deb0a
1 changed files with 2 additions and 2 deletions
|
@ -150,13 +150,13 @@ public static class Boyfriend {
|
||||||
if (!mData.IsInGuild) continue;
|
if (!mData.IsInGuild) continue;
|
||||||
if (mData.MutedUntil is null
|
if (mData.MutedUntil is null
|
||||||
&& ulong.TryParse(config["StarterRole"], out var starterRoleId)
|
&& ulong.TryParse(config["StarterRole"], out var starterRoleId)
|
||||||
|
&& guild.GetRole(starterRoleId) is not null
|
||||||
&& !mData.Roles.Contains(starterRoleId)) _ = user.AddRoleAsync(starterRoleId);
|
&& !mData.Roles.Contains(starterRoleId)) _ = user.AddRoleAsync(starterRoleId);
|
||||||
|
|
||||||
if (now >= mData.MutedUntil) {
|
if (now >= mData.MutedUntil) {
|
||||||
await Utils.UnmuteMemberAsync(
|
saveData = await Utils.UnmuteMemberAsync(
|
||||||
data, Client.CurrentUser.ToString(), user,
|
data, Client.CurrentUser.ToString(), user,
|
||||||
Messages.PunishmentExpired);
|
Messages.PunishmentExpired);
|
||||||
saveData = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = mData.Reminders.Count - 1; i >= 0; i--) {
|
for (var i = mData.Reminders.Count - 1; i >= 0; i--) {
|
||||||
|
|
Reference in a new issue