From 49a407a29de4d568dee6f1162f480409a526d92b Mon Sep 17 00:00:00 2001 From: bibin Date: Sun, 27 Dec 2020 19:00:50 +0100 Subject: [PATCH] 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 '. --- src/bot.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/bot.py diff --git a/src/bot.py b/src/bot.py new file mode 100644 index 0000000..dd34702 --- /dev/null +++ b/src/bot.py @@ -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)