aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar brad90four <[email protected]>2021-11-06 23:07:31 -0400
committerGravatar GitHub <[email protected]>2021-11-07 03:07:31 +0000
commit65cfed425e19fa508c7d4e8736deb55c564cecbb (patch)
tree5414b9466ee6498054c6ca0c0cb5b3d41747b8fe /bot
parentLimit user reactions on embed pagination (diff)
Handle `.wtf` command without query (#939)
Co-authored-by: Hedy Li <[email protected]> Co-authored-by: Xithrius <[email protected]>
Diffstat (limited to 'bot')
-rw-r--r--bot/exts/utilities/wtf_python.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/bot/exts/utilities/wtf_python.py b/bot/exts/utilities/wtf_python.py
index 66a022d7..980b3dba 100644
--- a/bot/exts/utilities/wtf_python.py
+++ b/bot/exts/utilities/wtf_python.py
@@ -79,7 +79,7 @@ class WTFPython(commands.Cog):
return match if certainty > MINIMUM_CERTAINTY else None
@commands.command(aliases=("wtf", "WTF"))
- async def wtf_python(self, ctx: commands.Context, *, query: str) -> None:
+ async def wtf_python(self, ctx: commands.Context, *, query: Optional[str] = None) -> None:
"""
Search WTF Python repository.
@@ -87,6 +87,18 @@ class WTFPython(commands.Cog):
Usage:
--> .wtf wild imports
"""
+ if query is None:
+ no_query_embed = Embed(
+ title="WTF Python?!",
+ colour=constants.Colours.dark_green,
+ description="A repository filled with suprising snippets that can make you say WTF?!\n\n"
+ f"[Go to the Repository]({BASE_URL})"
+ )
+ logo = File(LOGO_PATH, filename="wtf_logo.jpg")
+ no_query_embed.set_thumbnail(url="attachment://wtf_logo.jpg")
+ await ctx.send(embed=no_query_embed, file=logo)
+ return
+
if len(query) > 50:
embed = Embed(
title=random.choice(constants.ERROR_REPLIES),