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 '.
This commit is contained in:
parent
519f72d720
commit
49a407a29d
|
@ -0,0 +1,28 @@
|
||||||
|
"""
|
||||||
|
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)
|
Loading…
Reference in New Issue