1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-24 22:27:28 +00:00

Fixed hearted assigning a reference instead of copying the embed

This commit is contained in:
Myned 2017-11-21 06:14:12 -05:00
parent dbaa930d57
commit 59c0f93229

View file

@ -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}')