From 2a7259d1b82be70a5ea8bc41fcba2f37904fbc7e Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Thu, 3 Feb 2022 20:21:48 -0700 Subject: [PATCH] Async API calls --- jarvis/cogs/twitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarvis/cogs/twitter.py b/jarvis/cogs/twitter.py index f69369f..8f1ca59 100644 --- a/jarvis/cogs/twitter.py +++ b/jarvis/cogs/twitter.py @@ -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