fixed bug in highscores looking in old log folder

This commit is contained in:
phixxy 2024-01-27 13:18:22 -08:00
parent 21770c6054
commit 8a0e74a633

View file

@ -14,7 +14,7 @@ from discord.ext import commands
) )
async def highscores(ctx, limit=15): async def highscores(ctx, limit=15):
filename = str(ctx.channel.id) + ".log" filename = str(ctx.channel.id) + ".log"
with open("channels/logs/" + filename, 'r', encoding="utf-8") as logfile: with open("chatgpt/logs/" + filename, 'r', encoding="utf-8") as logfile:
data = logfile.readlines() data = logfile.readlines()
logfile.close() logfile.close()
@ -73,8 +73,8 @@ async def highscores_server(ctx, limit=15):
user_message_counts = {} user_message_counts = {}
data = [] data = []
for filename in os.listdir("channels/logs/"): for filename in os.listdir("chatgpt/logs/"):
with open("channels/logs/" + filename, 'r', encoding="utf-8") as logfile: with open("chatgpt/logs/" + filename, 'r', encoding="utf-8") as logfile:
data += logfile.readlines() data += logfile.readlines()
logfile.close() logfile.close()
user_message_counts = {} user_message_counts = {}