fixed book being slow
This commit is contained in:
parent
82cf5d9856
commit
08d8f424be
@ -248,14 +248,8 @@ class Book:
|
||||
else:
|
||||
await self._message.edit(content=self._pages[self._current_page], embed=None)
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
for emoji in self._bot.book_emojis.values():
|
||||
try:
|
||||
await self._message.add_reaction(emoji)
|
||||
except (discord.Forbidden, KeyError):
|
||||
pass
|
||||
|
||||
async def create_book(self) -> None:
|
||||
# noinspection PyUnresolvedReferences
|
||||
async def reaction_checker():
|
||||
def check(reaction, user):
|
||||
if self._locked:
|
||||
@ -265,6 +259,12 @@ class Book:
|
||||
|
||||
await self.display_page()
|
||||
|
||||
for emoji in self._bot.book_emojis.values():
|
||||
try:
|
||||
await self._message.add_reaction(emoji)
|
||||
except (discord.Forbidden, KeyError):
|
||||
pass
|
||||
|
||||
while True:
|
||||
try:
|
||||
reaction, user = await self._bot.wait_for('reaction_add', timeout=60, check=check)
|
||||
@ -297,7 +297,3 @@ class Book:
|
||||
await self.display_page()
|
||||
|
||||
self._bot.loop.create_task(reaction_checker())
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user