aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Anubhav1603 <[email protected]>2020-09-06 13:03:32 +0530
committerGravatar Anubhav1603 <[email protected]>2020-09-06 13:03:32 +0530
commitadc00a9e6e0394f349ee7f68fc3529c6e477677c (patch)
tree0d9e17b79ef7dbe079699a2f0341a82de9dde457
parentchanged search_description to s_desc cuz its failing E501 (diff)
corrected indexing problem
-rw-r--r--bot/exts/evergreen/wikipedia.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/exts/evergreen/wikipedia.py b/bot/exts/evergreen/wikipedia.py
index 4dec8bdf..05bfbe66 100644
--- a/bot/exts/evergreen/wikipedia.py
+++ b/bot/exts/evergreen/wikipedia.py
@@ -69,7 +69,11 @@ class WikipediaCog(commands.Cog):
try:
user = await ctx.bot.wait_for('message', timeout=60.0, check=check)
- await ctx.send(WIKIPEDIA_URL.format(title=final[int(user.content) - 1]))
+ response = int(user.content)
+ if response <= 0:
+ await ctx.send("Please enter a valid response")
+ else:
+ await ctx.send(WIKIPEDIA_URL.format(title=final[response - 1]))
except asyncio.TimeoutError:
embed = Embed(colour=Color.red(), description=f"Time's up {ctx.author.mention}")