Async API calls
This commit is contained in:
parent
dd8b3be19a
commit
2a7259d1b8
1 changed files with 1 additions and 1 deletions
|
@ -114,7 +114,7 @@ class TwitterCog(Scale):
|
|||
return
|
||||
|
||||
try:
|
||||
latest_tweet = self.api.user_timeline(screen_name=handle, count=1)[0]
|
||||
latest_tweet = await asyncio.to_thread(self.api.user_timeline, screen_name=handle)[0]
|
||||
except Exception:
|
||||
await ctx.send(
|
||||
"Unable to get user timeline. Are you sure the handle is correct?", hidden=True
|
||||
|
|
Loading…
Add table
Reference in a new issue