Skip to content

Commit 672a5f5

Browse files
committed
Wait until ready before logging
1 parent 26791b5 commit 672a5f5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/thread.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,14 @@ async def send(self, message, destination=None,
365365
)))
366366
self.bot.loop.create_task(tasks)
367367

368+
if not self.ready:
369+
await self.wait_until_ready()
370+
368371
if not from_mod and not note:
369372
self.bot.loop.create_task(
370373
self.bot.api.append_log(message, self.channel.id)
371374
)
372375

373-
if not self.ready:
374-
await self.wait_until_ready()
375-
376376
destination = destination or self.channel
377377

378378
author = message.author
@@ -556,6 +556,7 @@ async def find(self, *, recipient=None, channel=None):
556556
if channel:
557557
thread = Thread(self, recipient, channel)
558558
self.cache[recipient.id] = thread
559+
thread.ready = True
559560
return thread
560561

561562
async def _find_from_channel(self, channel):

0 commit comments

Comments
 (0)