Clear action miss some vars and update list now check if the message still exists
This commit is contained in:
parent
c961274377
commit
4bb5695bd4
1 changed files with 18 additions and 15 deletions
|
@ -208,7 +208,9 @@ class Speak(commands.Cog):
|
||||||
self.voice_chan = None
|
self.voice_chan = None
|
||||||
if self.last_message:
|
if self.last_message:
|
||||||
await self.last_message.delete()
|
await self.last_message.delete()
|
||||||
|
self.last_message = None
|
||||||
await self.voice_message.delete()
|
await self.voice_message.delete()
|
||||||
|
self.voice_message = None
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_reaction_remove(self, reaction: Reaction, user: Member):
|
async def on_reaction_remove(self, reaction: Reaction, user: Member):
|
||||||
|
@ -221,6 +223,7 @@ class Speak(commands.Cog):
|
||||||
await self.update_list(reaction.message.channel.guild)
|
await self.update_list(reaction.message.channel.guild)
|
||||||
|
|
||||||
async def update_list(self, guild: Guild):
|
async def update_list(self, guild: Guild):
|
||||||
|
if self.voice_message:
|
||||||
persons = []
|
persons = []
|
||||||
if len(self.reaction) != 0:
|
if len(self.reaction) != 0:
|
||||||
for i, reaction in enumerate(self.reaction):
|
for i, reaction in enumerate(self.reaction):
|
||||||
|
|
Reference in a new issue