diff --git a/redbot/vendored/discord-ext-menus.LICENSE b/redbot/vendored/discord-ext-menus.LICENSE index b0d778919..f71e9c169 100644 --- a/redbot/vendored/discord-ext-menus.LICENSE +++ b/redbot/vendored/discord-ext-menus.LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2019 Danny Y. (Rapptz) +Copyright (c) 2015-2020 Danny Y. (Rapptz) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/redbot/vendored/discord/ext/menus/__init__.py b/redbot/vendored/discord/ext/menus/__init__.py index 64c8980ae..142a95bd8 100644 --- a/redbot/vendored/discord/ext/menus/__init__.py +++ b/redbot/vendored/discord/ext/menus/__init__.py @@ -541,13 +541,14 @@ class Menu(metaclass=_MenuMeta): """ if payload.message_id != self.message.id: return False - if payload.user_id not in (self.bot.owner_id, self._author_id): + if payload.user_id not in {self.bot.owner_id, self._author_id, *self.bot.owner_ids}: return False return payload.emoji in self.buttons async def _internal_loop(self): try: + self.__timed_out = False loop = self.bot.loop # Ensure the name exists for the cancellation handling tasks = [] @@ -579,7 +580,7 @@ class Menu(metaclass=_MenuMeta): # consider this my warning. except asyncio.TimeoutError: - pass + self.__timed_out = True finally: self._event.set() @@ -588,9 +589,11 @@ class Menu(metaclass=_MenuMeta): task.cancel() try: - await self.finalize() + await self.finalize(self.__timed_out) except Exception: pass + finally: + self.__timed_out = False # Can't do any requests if the bot is closed if self.bot.is_closed(): @@ -701,12 +704,17 @@ class Menu(metaclass=_MenuMeta): if wait: await self._event.wait() - async def finalize(self): + async def finalize(self, timed_out): """|coro| A coroutine that is called when the menu loop has completed its run. This is useful if some asynchronous clean-up is required after the fact. + + Parameters + -------------- + timed_out: :class:`bool` + Whether the menu completed due to timing out. """ return