mirror of
https://gitlab.com/simple-stock-bots/simple-discord-stock-bot.git
synced 2025-08-02 11:31:26 +00:00
ported news and info commands from telegram bot
This commit is contained in:
18
bot.py
18
bot.py
@@ -22,10 +22,28 @@ async def on_message(message):
|
||||
await message.channel.send(reply)
|
||||
else:
|
||||
await message.channel.send("No tickers found.")
|
||||
|
||||
elif message.content.startswith("/news"):
|
||||
replies = tickerNews(getTickers(message.content))
|
||||
if replies:
|
||||
for tick, reply in replies.items():
|
||||
await message.channel.send(reply)
|
||||
else:
|
||||
await message.channel.send("No tickers found.")
|
||||
|
||||
elif message.content.startswith("/info"):
|
||||
replies = tickerInfo(getTickers(message.content))
|
||||
if replies:
|
||||
for tick, reply in replies.items():
|
||||
await message.channel.send(reply)
|
||||
else:
|
||||
await message.channel.send("No tickers found.")
|
||||
|
||||
elif message.content.startswith('/help'):
|
||||
"""Send link to docs when the command /help is issued."""
|
||||
message = "[Please see the docs for Bot information](https://simple-stock-bots.gitlab.io/site/discord/)"
|
||||
await message.channel.send(message)
|
||||
|
||||
# If no commands, check for any tickers.
|
||||
else:
|
||||
replies = tickerDataReply(getTickers(message.content))
|
||||
|
Reference in New Issue
Block a user