From d6d0809714719e50c6ef50df6343fb578714225b Mon Sep 17 00:00:00 2001 From: sgoudham Date: Thu, 4 Jun 2020 21:02:29 +0100 Subject: [PATCH] Trying to get directories working with files --- cogs/FunCommands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cogs/FunCommands.py b/cogs/FunCommands.py index 68db50ed..2145e07d 100644 --- a/cogs/FunCommands.py +++ b/cogs/FunCommands.py @@ -1,4 +1,5 @@ import asyncio +import pathlib import random import discord @@ -95,8 +96,8 @@ class Fun(commands.Cog): channels = ["bot-commands"] - # path = pathlib.Path(r'C:\Users\sgoud\PycharmProjects\EnsoBot\txtfiles\eightball.txt') - with open('eightball.txt') as file: + path = pathlib.Path(r'C:/Users/sgoud/PycharmProjects/EnsoBot/txtfiles/eightball.txt') + with open(path) as file: _8ball_array = file.readlines() if str(ctx.channel) in channels: