From 2e4564c7bfe9cb9be83aeba60d4f315e04555768 Mon Sep 17 00:00:00 2001 From: Pythonic-Rainbow Date: Mon, 8 Mar 2021 00:31:00 +0000 Subject: [PATCH] Ensures quote i can fetch user --- bottas.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bottas.py b/bottas.py index 9698a13..11c03d1 100644 --- a/bottas.py +++ b/bottas.py @@ -53,7 +53,10 @@ async def index(self, ctx, index: int = 0): while not quote: # Randomly generates a valid quote index = random.randint(1, count) quote = self.get_quote(index) - content += f"Quote #{index}:\n> {quote[0]} - {quote[1]}\n Uploaded by {self.bot.get_user(quote[2])}" + user = self.bot.get_user(quote[2]) + if not user: + user = await self.bot.fetch_user(quote[2]) + content += f"Quote #{index}:\n> {quote[0]} - {quote[1]}\n Uploaded by {user}" await ctx.send(content) # Sends the quote @quote.command(aliases=['q'])