From 2dbcf97f37f7c11d80b55e18c9c04ae2e5c16820 Mon Sep 17 00:00:00 2001 From: Anson Biggs Date: Thu, 11 Feb 2021 18:02:12 -0700 Subject: [PATCH] Close #7 --- bot.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 8028e5c..7627f5f 100644 --- a/bot.py +++ b/bot.py @@ -91,8 +91,28 @@ async def chart(ctx, cmd: str): @bot.command() -async def crypto(ctx, cmd: str): - await ctx.send("crypto" + cmd) +async def crypto(ctx, symbol: str): + reply = s.crypto_reply(symbol) + await ctx.send(reply) + + +@bot.event +async def on_message(message): + + if message.author == client.user: + return + + if message.content[0] == "/": + await bot.process_commands(message) + return + + if "$" in message.content: + symbols = s.find_symbols(message.content) + + if symbols: + for reply in s.price_reply(symbols).items(): + await message.channel.send(reply[1]) + return s = Symbol(IEX_TOKEN)