Trying to get directories working with files

testing
sgoudham 5 years ago
parent d6d0809714
commit b8a0b164e3

@ -1,5 +1,4 @@
import asyncio
import pathlib
import random
import discord
@ -96,8 +95,8 @@ class Fun(commands.Cog):
channels = ["bot-commands"]
path = pathlib.Path(r'C:/Users/sgoud/PycharmProjects/EnsoBot/txtfiles/eightball.txt')
with open(path) as file:
# path = pathlib.Path(r'C:/Users/sgoud/PycharmProjects/EnsoBot/txtfiles/eightball.txt')
with open('eightball.txt') as file:
_8ball_array = file.readlines()
if str(ctx.channel) in channels:
@ -111,8 +110,6 @@ class Fun(commands.Cog):
# Delete the message
await message.delete()
file.close()
def error_function():
return "Sorry! I only work in #bot-commands!"

@ -39,8 +39,6 @@ class Waifus(commands.Cog):
# Delete the message
await message.delete()
file.close()
# Bot ~Toga command for Josh
@commands.command(aliases=['Toga'])
@cooldown(1, 0, BucketType.channel)

Loading…
Cancel
Save