diff --git a/bot/__init__.py b/bot/__init__.py index 9f356c89..a6d325cc 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -165,6 +165,12 @@ class Bot(commands.Bot): # Start the background task(s) change_status.start() + # Run the bot, allowing it to come online + try: + self.run(API_TOKEN) + except discord.errors.LoginFailure as e: + print(e, "Login unsuccessful.") + # --------------------------------------------!Cache Section!------------------------------------------------------- def store_cache(self, guildid, prefix, channel, rolespersist): @@ -536,4 +542,4 @@ class Bot(commands.Bot): await conn.commit() print(cur.rowcount, f"{member} Left {member.guild.name}, Roles stored into Members") - # --------------------------------------------!End Events Section!-------------------------------------------------- + # --------------------------------------------!End Events Section!---------------------------------------------- diff --git a/bot/main.py b/bot/main.py index 5a549ad9..541b8be6 100644 --- a/bot/main.py +++ b/bot/main.py @@ -15,15 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import discord - -from bot import Bot, API_TOKEN +from bot import Bot # Initiating Bot Object As Client client = Bot() - -# Run the bot, allowing it to come online -try: - client.run(API_TOKEN) -except discord.errors.LoginFailure as e: - print("Login unsuccessful.")