mirror of
https://gitlab.com/simple-stock-bots/simple-discord-stock-bot.git
synced 2025-08-02 19:41:37 +00:00
finished importing new functions code
This commit is contained in:
28
bot.py
28
bot.py
@@ -16,40 +16,40 @@ async def on_message(message):
|
|||||||
|
|
||||||
# Check for dividend command
|
# Check for dividend command
|
||||||
if message.content.startswith("/dividend"):
|
if message.content.startswith("/dividend"):
|
||||||
replies = tickerDividend(getTickers(message.content))
|
replies = symbolDividend(getSymbols(message.content))
|
||||||
if replies:
|
if replies:
|
||||||
for tick, reply in replies.items():
|
for reply in replies.items():
|
||||||
await message.channel.send(reply)
|
await message.channel.send(reply[1])
|
||||||
else:
|
else:
|
||||||
await message.channel.send("No tickers found.")
|
await message.channel.send("No tickers found.")
|
||||||
|
|
||||||
elif message.content.startswith("/news"):
|
elif message.content.startswith("/news"):
|
||||||
replies = tickerNews(getTickers(message.content))
|
replies = symbolNews(getSymbols(message.content))
|
||||||
if replies:
|
if replies:
|
||||||
for tick, reply in replies.items():
|
for reply in replies.items():
|
||||||
await message.channel.send(reply)
|
await message.channel.send(reply[1])
|
||||||
else:
|
else:
|
||||||
await message.channel.send("No tickers found.")
|
await message.channel.send("No tickers found.")
|
||||||
|
|
||||||
elif message.content.startswith("/info"):
|
elif message.content.startswith("/info"):
|
||||||
replies = tickerInfo(getTickers(message.content))
|
replies = symbolInfo(getSymbols(message.content))
|
||||||
if replies:
|
if replies:
|
||||||
for tick, reply in replies.items():
|
for reply in replies.items():
|
||||||
await message.channel.send(reply)
|
await message.channel.send(reply[1])
|
||||||
else:
|
else:
|
||||||
await message.channel.send("No tickers found.")
|
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."""
|
"""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)
|
await message.channel.send(message)
|
||||||
|
|
||||||
# If no commands, check for any tickers.
|
# If no commands, check for any tickers.
|
||||||
else:
|
else:
|
||||||
replies = tickerDataReply(getTickers(message.content))
|
replies = symbolDataReply(getSymbols(message.content))
|
||||||
if replies:
|
if replies:
|
||||||
for symbol, reply in replies.items():
|
for reply in replies.items():
|
||||||
await message.channel.send(reply)
|
await message.channel.send(reply[1])
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user