mirror of
https://github.com/myned/modufur.git
synced 2024-12-24 14:27:27 +00:00
Fixed hearted assigning a reference instead of copying the embed
This commit is contained in:
parent
dbaa930d57
commit
59c0f93229
1 changed files with 9 additions and 8 deletions
|
@ -7,6 +7,7 @@ from contextlib import suppress
|
|||
from datetime import datetime as dt
|
||||
from datetime import timedelta as td
|
||||
from fractions import gcd
|
||||
import copy
|
||||
|
||||
import discord as d
|
||||
from discord import errors as err
|
||||
|
@ -729,12 +730,12 @@ class MsG:
|
|||
self.bot.wait_for('reaction_remove', check=on_reaction, timeout=7 * 60)])
|
||||
|
||||
except exc.Save:
|
||||
if embed not in hearted:
|
||||
hearted.append(embed)
|
||||
if keys[c - 1] not in hearted:
|
||||
hearted[keys[c - 1]] = copy.deepcopy(embed)
|
||||
|
||||
await paginator.edit(content='\N{HEAVY BLACK HEART}')
|
||||
else:
|
||||
hearted.remove(embed)
|
||||
del hearted[keys[c - 1]]
|
||||
|
||||
await paginator.edit(content='\N{BROKEN HEART}')
|
||||
|
||||
|
@ -871,8 +872,8 @@ class MsG:
|
|||
self.bot.wait_for('reaction_remove', check=on_reaction, timeout=7 * 60)])
|
||||
|
||||
except exc.Save:
|
||||
if keys[c - 1] not in hearted:
|
||||
hearted[keys[c - 1]] = embed
|
||||
if keys[c - 1] not in hearted.keys():
|
||||
hearted[keys[c - 1]] = copy.deepcopy(embed)
|
||||
|
||||
await paginator.edit(content='\N{HEAVY BLACK HEART}')
|
||||
else:
|
||||
|
@ -1037,12 +1038,12 @@ class MsG:
|
|||
self.bot.wait_for('reaction_remove', check=on_reaction, timeout=7 * 60)])
|
||||
|
||||
except exc.Save:
|
||||
if embed not in hearted:
|
||||
hearted.append(embed)
|
||||
if keys[c - 1] not in hearted:
|
||||
hearted[keys[c - 1]] = copy.deepcopy(embed)
|
||||
|
||||
await paginator.edit(content='\N{HEAVY BLACK HEART}')
|
||||
else:
|
||||
hearted.remove(embed)
|
||||
del hearted[keys[c - 1]]
|
||||
|
||||
await paginator.edit(content='\N{BROKEN HEART}')
|
||||
|
||||
|
|
Loading…
Reference in a new issue