1
0
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:
2019-06-11 05:37:10 -07:00
parent d0b04a253b
commit cf6b03e31a
2 changed files with 61 additions and 0 deletions

18
bot.py
View File

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