look in data folder for logs

This commit is contained in:
phixxy 2024-01-27 13:20:53 -08:00
parent 64810982fa
commit b21d37b124

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("chatgpt/logs/" + filename, 'r', encoding="utf-8") as logfile: with open("data/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("chatgpt/logs/"): for filename in os.listdir("data/chatgpt/logs/"):
with open("chatgpt/logs/" + filename, 'r', encoding="utf-8") as logfile: with open("data/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 = {}