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:

Loading…
Cancel
Save