mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[Mod] fix duplicate cases on ban/unban (fixes Cog-Creators/Red-DiscordBot/issues/1052) (#1064)
This commit is contained in:
parent
897adbf5ac
commit
d6fce3c145
@ -1167,8 +1167,9 @@ class Mod:
|
||||
mod = audit_case.user
|
||||
reason = audit_case.reason
|
||||
for case in sorted(modlog_cases, key=lambda x: x.case_number, reverse=True):
|
||||
if case.moderator == mod and case.user == member\
|
||||
if mod == guild.me and case.user == member\
|
||||
and case.action_type in ["ban", "hackban"]:
|
||||
log.info("Case already exists for ban of {}".format(member.name))
|
||||
break
|
||||
else: # no ban, softban, or hackban case with the mod and user combo
|
||||
try:
|
||||
@ -1231,8 +1232,9 @@ class Mod:
|
||||
|
||||
cases = await modlog.get_all_cases(guild, self.bot)
|
||||
for case in sorted(cases, key=lambda x: x.case_number, reverse=True):
|
||||
if case.moderator == mod and case.user == user\
|
||||
and case.action_type == "unban":
|
||||
if mod == guild.me and case.user == user\
|
||||
and case.action_type == "unban":
|
||||
log.info("Case already exists for unban of {}".format(user.name))
|
||||
break
|
||||
else:
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user