mirror of
https://gitlab.com/simple-stock-bots/simple-discord-stock-bot.git
synced 2025-06-16 15:17:29 +00:00
Close #7
This commit is contained in:
parent
819343e440
commit
2dbcf97f37
24
bot.py
24
bot.py
@ -91,8 +91,28 @@ async def chart(ctx, cmd: str):
|
|||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def crypto(ctx, cmd: str):
|
async def crypto(ctx, symbol: str):
|
||||||
await ctx.send("crypto" + cmd)
|
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)
|
s = Symbol(IEX_TOKEN)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user