Making sure other people can't close help embed

pull/4/head
sgoudham 4 years ago
parent ff3f07ba9e
commit 3a6f6f702d

@ -261,13 +261,21 @@ class HelpMenu(menus.Menu):
@menus.button('\N{BLACK SQUARE FOR STOP}\ufe0f') @menus.button('\N{BLACK SQUARE FOR STOP}\ufe0f')
async def on_stop(self, payload): async def on_stop(self, payload):
# Send the stop embed which shows that the help commands embed is no longer accessible
stop = stop_embed(self)
await self.message.edit(embed=stop)
# Clear the reactions in the message and stop the function # Simple check to make sure that the reaction is performed by the user
await self.message.clear_reactions() def check(m):
self.stop() return m.author == payload.member
if not check(self.ctx):
return
else:
# Send the stop embed which shows that the help commands embed is no longer accessible
stop = stop_embed(self)
await self.message.edit(embed=stop)
# Clear the reactions in the message and stop the function
await self.message.clear_reactions()
self.stop()
# Set up the cog # Set up the cog

Loading…
Cancel
Save