-
Notifications
You must be signed in to change notification settings - Fork 1
/
bot.py
31 lines (24 loc) · 882 Bytes
/
bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
from discord.ext import commands
from dotenv import load_dotenv
import robin_stocks as r
from stocks import stock_controller as s
bot = commands.Bot(command_prefix='.')
load_dotenv()
rhlogin = r.login(username=os.getenv('RH_USER'), password=os.getenv('RH_PASS'))
initExt = [
'bot.commands.StockCommands',
'bot.commands.OptionCommands',
'bot.commands.BotCommands',
'bot.tasks.Background',
'bot.commands.MiscCommands',
]
if __name__ == '__main__':
for ext in initExt:
try:
bot.load_extension(ext)
except Exception as e:
print('Failed to load extension {}\n{}: {}'.format(ext, type(e).__name__, e))
s.readStocksMentioned() # Populate stocks_mentioned dictionary with .csv items
# a.prepare_Anomalies() # Populate option value for SPY friday option chain
bot.run(os.getenv('DISCORD_TOKEN'))