From c6203420af97e020d5aca2337b4c0649b930463d Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Fri, 8 Jan 2021 13:31:36 -0800 Subject: [PATCH] Adding the wolfram alpha functionality back --- app/bot.py | 6 ++++++ app/help_methods.py | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/bot.py b/app/bot.py index 4e3a8979..b80f9ddb 100755 --- a/app/bot.py +++ b/app/bot.py @@ -49,6 +49,12 @@ async def on_ready(): # f'Hi {member.name}, welcome to my ths server!' # ) +@bot.command(name='ask') +async def ask(ctx): + import questions + await ctx.send( + questions.answer_question(ctx.message.content) + ) @bot.command(name='invite') async def invite(ctx): diff --git a/app/help_methods.py b/app/help_methods.py index b46422a6..7749bb1a 100644 --- a/app/help_methods.py +++ b/app/help_methods.py @@ -13,6 +13,10 @@ def get_help_message(method): 'Ask dragon bot a question and it will give you an 8ball response', '\nUsage: !8ball Will I win the lottery tomorrow?' ], + 'ask': [ + 'Submits your query to wolfram alpha. If that cannot be answered, tries wikipedia\n', + '\nUsage: !ask 100lbs to KG' + ], 'avatar': [ 'Returns the avatar for the mentioned user', '\nUsage: !avatar @somebody' @@ -171,7 +175,7 @@ def get_help_message(method): def get_help_embed(bot): categories = { 'fun': ['ffxiv', 'clap', 'redpanda', 'birb', 'youtube', 'dog', 'excuse', 'greentext', 'lewd', 'message', 'meme', 'homepage', 'pout', 'roll', 'smug', 'quake', 'wink', 'verify'], - 'util': ['corona', 'emoji', '8ball', 'decide', 'info', 'icon', 'wallpaper', 'stock', 'tts', 'issue'], + 'util': ['ask', 'corona', 'emoji', '8ball', 'decide', 'info', 'icon', 'wallpaper', 'stock', 'tts', 'issue'], 'users': ['help', 'invite', 'purge', 'roles', 'source'], 'admin': ['cleanup'] }