1
0
mirror of https://gitlab.com/simple-stock-bots/simple-discord-stock-bot.git synced 2025-08-02 11:31:26 +00:00

finished importing new functions code

This commit is contained in:
2019-07-10 13:32:26 -07:00
parent 68209c14c0
commit 19bcb9f935

28
bot.py
View File

@@ -16,40 +16,40 @@ async def on_message(message):
# Check for dividend command
if message.content.startswith("/dividend"):
replies = tickerDividend(getTickers(message.content))
replies = symbolDividend(getSymbols(message.content))
if replies:
for tick, reply in replies.items():
await message.channel.send(reply)
for reply in replies.items():
await message.channel.send(reply[1])
else:
await message.channel.send("No tickers found.")
elif message.content.startswith("/news"):
replies = tickerNews(getTickers(message.content))
replies = symbolNews(getSymbols(message.content))
if replies:
for tick, reply in replies.items():
await message.channel.send(reply)
for reply in replies.items():
await message.channel.send(reply[1])
else:
await message.channel.send("No tickers found.")
elif message.content.startswith("/info"):
replies = tickerInfo(getTickers(message.content))
replies = symbolInfo(getSymbols(message.content))
if replies:
for tick, reply in replies.items():
await message.channel.send(reply)
for reply in replies.items():
await message.channel.send(reply[1])
else:
await message.channel.send("No tickers found.")
elif message.content.startswith('/help'):
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/)"
reply = "[Please see the documentation 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))
replies = symbolDataReply(getSymbols(message.content))
if replies:
for symbol, reply in replies.items():
await message.channel.send(reply)
for reply in replies.items():
await message.channel.send(reply[1])
else:
return