diff --git a/app/bot.py b/app/bot.py index 8ef5507d..77788ca8 100755 --- a/app/bot.py +++ b/app/bot.py @@ -133,4 +133,19 @@ async def fix_tiktok_links(ctx): return +@bot.event +async def on_message(ctx): + if str(bot.user.id) in ctx.content: + import wolframalpha + + client = wolframalpha.Client(os.getenv("wolfram_token")) + query = " ".join(ctx.content.split()[1:]) + try: + res = client.query(query) + return await ctx.reply(next(res.results).text) + except Exception as e: + print(e) + return await ctx.reply("Sorry, I'm unable to answer that") + + bot.run(os.getenv("discord_token"))