Trying to change token and get the bot online

testing
sgoudham 5 years ago
parent 9f48237fb3
commit f32075fe67

@ -7,11 +7,9 @@ from discord.ext import commands
# Getting the Bot token from Environment Variables # Getting the Bot token from Environment Variables
API_TOKEN = config('DISCORD_TOKEN') API_TOKEN = config('DISCORD_TOKEN')
# Bot Prefix # Bot Prefix
client = commands.Bot(command_prefix='~') client = commands.Bot(command_prefix='~')
# Instantiates a list for all the cogs # Instantiates a list for all the cogs
extensions = ['cogs.WaifuImages', 'cogs.FunCommands'] extensions = ['cogs.WaifuImages', 'cogs.FunCommands']
@ -88,8 +86,10 @@ async def on_command_error(ctx, error):
await message.delete() await message.delete()
client.run(API_TOKEN) try:
client.run(API_TOKEN)
except discord.errors.LoginFailure as e:
print("Login unsuccessful.")
''' '''
@client.command() @client.command()

@ -1,7 +1,6 @@
import asyncio import asyncio
import pathlib import pathlib
import random import random
import discord import discord
from discord.ext import commands from discord.ext import commands
from discord.ext.commands import BucketType, cooldown from discord.ext.commands import BucketType, cooldown
@ -101,7 +100,6 @@ class Fun(commands.Cog):
_8ball_array = file.readlines() _8ball_array = file.readlines()
if str(ctx.channel) in channels: if str(ctx.channel) in channels:
await ctx.send(f'Question: {question}\nAnswer: {random.choice(_8ball_array)}') await ctx.send(f'Question: {question}\nAnswer: {random.choice(_8ball_array)}')
else: else:
@ -112,7 +110,7 @@ class Fun(commands.Cog):
# Delete the message # Delete the message
await message.delete() await message.delete()
file.close() file.close()
def error_function(): def error_function():

@ -40,7 +40,7 @@ class Waifus(commands.Cog):
# Delete the message # Delete the message
await message.delete() await message.delete()
file.close() file.close()
# Bot ~Toga command for Josh # Bot ~Toga command for Josh
@commands.command(aliases=['Toga']) @commands.command(aliases=['Toga'])
@ -70,7 +70,7 @@ class Waifus(commands.Cog):
# Delete the message # Delete the message
await message.delete() await message.delete()
file.close() file.close()
def error_function(): def error_function():

@ -50,4 +50,4 @@
“Hamothy has used his godlike like powers to align the stars for you it must be true“ “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“ “Gabriel appears out of thin air and smites you“
“Yes yes yes!!!“ “Yes yes yes!!!“
"niKki sAys gO gEts tHeM HorSie" "niKki sAys gO gEts tHeM HorSie"
Loading…
Cancel
Save