1
0
mirror of https://gitlab.com/simple-stock-bots/simple-discord-stock-bot.git synced 2025-06-16 07:16:41 +00:00
This commit is contained in:
Anson Biggs 2021-02-11 18:02:12 -07:00
parent 819343e440
commit 2dbcf97f37

24
bot.py
View File

@ -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)