discord-bot/src/bot.py
bibin 49a407a29d Initial: Add basic main discord.py bot file
This only connects to the discord application and does nothing yet.
Access the token through a hidden environment file.
Set the command prefix to '$b '.
2020-12-27 19:00:50 +01:00

28 lines
482 B
Python

"""
This is the main module of the Discord Bot
Mainly loads the Cog's and starts the bot
"""
__version__ = '0.5'
__author__ = 'Bibin Muttappillil'
# standard library imports
import os
from dotenv import load_dotenv
# discord imports
from discord.ext import commands
# Token stuff
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
if TOKEN is None:
print("Missing discord token!")
exit(1)
bot = commands.Bot(command_prefix=commands.when_mentioned_or('$b '))
bot.run(TOKEN)