From f32075fe6755c5dade33dc344ac1b3d0a962380c Mon Sep 17 00:00:00 2001 From: sgoudham Date: Thu, 4 Jun 2020 20:06:18 +0100 Subject: [PATCH] Trying to change token and get the bot online --- EnsoBot.py | 8 ++++---- cogs/FunCommands.py | 4 +--- cogs/WaifuImages.py | 4 ++-- cogs/__pycache__/FunCommands.cpython-36.pyc | Bin 6576 -> 6576 bytes cogs/__pycache__/WaifuImages.cpython-36.pyc | Bin 2500 -> 2500 bytes txtfiles/eightball.txt | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/EnsoBot.py b/EnsoBot.py index 74fb75e9..e69de8a0 100644 --- a/EnsoBot.py +++ b/EnsoBot.py @@ -7,11 +7,9 @@ from discord.ext import commands # Getting the Bot token from Environment Variables API_TOKEN = config('DISCORD_TOKEN') - # Bot Prefix client = commands.Bot(command_prefix='~') - # Instantiates a list for all the cogs extensions = ['cogs.WaifuImages', 'cogs.FunCommands'] @@ -88,8 +86,10 @@ async def on_command_error(ctx, error): await message.delete() -client.run(API_TOKEN) - +try: + client.run(API_TOKEN) +except discord.errors.LoginFailure as e: + print("Login unsuccessful.") ''' @client.command() diff --git a/cogs/FunCommands.py b/cogs/FunCommands.py index edec6fd7..8d50d3c1 100644 --- a/cogs/FunCommands.py +++ b/cogs/FunCommands.py @@ -1,7 +1,6 @@ import asyncio import pathlib import random - import discord from discord.ext import commands from discord.ext.commands import BucketType, cooldown @@ -101,7 +100,6 @@ class Fun(commands.Cog): _8ball_array = file.readlines() if str(ctx.channel) in channels: - await ctx.send(f'Question: {question}\nAnswer: {random.choice(_8ball_array)}') else: @@ -112,7 +110,7 @@ class Fun(commands.Cog): # Delete the message await message.delete() - file.close() + file.close() def error_function(): diff --git a/cogs/WaifuImages.py b/cogs/WaifuImages.py index 5df252f8..b2d76afe 100644 --- a/cogs/WaifuImages.py +++ b/cogs/WaifuImages.py @@ -40,7 +40,7 @@ class Waifus(commands.Cog): # Delete the message await message.delete() - file.close() + file.close() # Bot ~Toga command for Josh @commands.command(aliases=['Toga']) @@ -70,7 +70,7 @@ class Waifus(commands.Cog): # Delete the message await message.delete() - file.close() + file.close() def error_function(): diff --git a/cogs/__pycache__/FunCommands.cpython-36.pyc b/cogs/__pycache__/FunCommands.cpython-36.pyc index 29ffb02bcf327b754cf7d0e9450b4559fb78e119..a1f218f5adfd18a98cae8f6bec84a93a03c88315 100644 GIT binary patch delta 77 zcmdmByup~$n3tF9y35VDtc{%0L>UVvFA&WU3};AT2xJIih+wE;&EjolVB9P#7Q@KF hsKPA7EWjkOxlvq!k+F30B8hCq%E^3^^O>_bSO7HU6G;F7 delta 77 zcmdmByup~$n3tDJT=!;N!A8z$qKp-j7l`Hv*05&rHZw3XgfpZt1Tq9ML~NE7i(%wo hQehTi7GUDr+$gTV$XGUckwi9Q)nq=&`OG;SECBze5_$jt diff --git a/cogs/__pycache__/WaifuImages.cpython-36.pyc b/cogs/__pycache__/WaifuImages.cpython-36.pyc index 17bccd489aad13b1c02326e635775c3494e9efa7..ada762b31ad18a50a23c9a0fc040674bcb3106d4 100644 GIT binary patch delta 89 zcmX>id_4%r)?r#F7|xKw5Xcb35W!Hxk|oy6z_|G}lOhwN X#AIGpADl`g*_JReN^IW8&c*})LW>rW delta 89 zcmX>id_oBbotYOI#Yi3|%2xmxP2xJIih}is^Ns)<> XZ!#~d4^AbLY)cp!`8MxkXJY~Y4pJ4^ diff --git a/txtfiles/eightball.txt b/txtfiles/eightball.txt index ae678940..0ccb73d6 100644 --- a/txtfiles/eightball.txt +++ b/txtfiles/eightball.txt @@ -50,4 +50,4 @@ “Hamothy has used his godlike like powers to align the stars for you it must be true“ “Gabriel appears out of thin air and smites you“ “Yes yes yes!!!“ -"niKki sAys gO gEts tHeM HorSie" +"niKki sAys gO gEts tHeM HorSie" \ No newline at end of file