Files
OpenBB/discordbot/discordbot.py
northern-64bit f93deafa5e Adding the Discord Bot (#766)
* Adding the Discord Bot

From https://github.com/GamestonkTerminal/DiscordBot.

* Fixed code format to GST

* Fixed spelling

* Fixed check errors

* Reformated with pre-commit

* Fixed names of files
2021-09-29 16:13:59 -07:00

30 lines
775 B
Python

import discord
import discord_components
import pyimgur
import config_discordbot as cfg
activity = discord.Game(
name="Gametonk Terminal: https://github.com/GamestonkTerminal/GamestonkTerminal"
)
gst_bot = discord.ext.commands.Bot(
command_prefix=cfg.COMMAND_PREFIX, intents=discord.Intents.all(), activity=activity
)
discord_components.DiscordComponents(gst_bot)
async def on_ready():
print("GST Discord Bot Ready to Gamestonk!")
gst_imgur = pyimgur.Imgur(cfg.IMGUR_CLIENT_ID)
# Loads the commands (Cogs) from each "context"
gst_bot.load_extension("generic_commands")
gst_bot.load_extension("economy.economy_menu")
gst_bot.load_extension("stocks.dark_pool_shorts.dps_menu")
# Runs the bot
gst_bot.run(cfg.DISCORD_BOT_TOKEN)