mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Mod] Correctly log and store the previous (nick)name (#4131)
This commit is contained in:
parent
8a75d75d83
commit
88503bbf24
@ -157,10 +157,10 @@ class Events(MixinMeta):
|
||||
async with self.config.user(before).past_names() as name_list:
|
||||
while None in name_list: # clean out null entries from a bug
|
||||
name_list.remove(None)
|
||||
if after.name in name_list:
|
||||
if before.name in name_list:
|
||||
# Ensure order is maintained without duplicates occurring
|
||||
name_list.remove(after.name)
|
||||
name_list.append(after.name)
|
||||
name_list.remove(before.name)
|
||||
name_list.append(before.name)
|
||||
while len(name_list) > 20:
|
||||
name_list.pop(0)
|
||||
|
||||
@ -173,8 +173,8 @@ class Events(MixinMeta):
|
||||
async with self.config.member(before).past_nicks() as nick_list:
|
||||
while None in nick_list: # clean out null entries from a bug
|
||||
nick_list.remove(None)
|
||||
if after.nick in nick_list:
|
||||
nick_list.remove(after.nick)
|
||||
nick_list.append(after.nick)
|
||||
if before.nick in nick_list:
|
||||
nick_list.remove(before.nick)
|
||||
nick_list.append(before.nick)
|
||||
while len(nick_list) > 20:
|
||||
nick_list.pop(0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user