removed handle_error in highscores

This commit is contained in:
phixxy 2024-01-24 23:48:02 -08:00
parent 8ee00860b8
commit ea99494fdb

View file

@ -2,17 +2,9 @@
import os import os
import time import time
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import discord import discord
from discord.ext import commands from discord.ext import commands
async def handle_error(error):
print(error)
current_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
log_line = current_time + ': ' + str(error) + '\n'
with open("databases/error_log.txt", 'a') as f:
f.write(log_line)
return error
@commands.command( @commands.command(
description="Highscores", description="Highscores",
@ -44,7 +36,7 @@ async def highscores(ctx, limit=15):
else: else:
user_message_counts[user] += 1 user_message_counts[user] += 1
except Exception as error: except Exception as error:
await handle_error(error) print("Error occurred in highscores")
sorted_message_counts = sorted(user_message_counts.items(), key=lambda x:x[1]) sorted_message_counts = sorted(user_message_counts.items(), key=lambda x:x[1])
sorted_dict = dict(sorted_message_counts[-limit::]) sorted_dict = dict(sorted_message_counts[-limit::])
@ -95,7 +87,7 @@ async def highscores_server(ctx, limit=15):
else: else:
user_message_counts[user] += 1 user_message_counts[user] += 1
except Exception as error: except Exception as error:
await handle_error(error) print("Error occurred in highscores_server")
sorted_message_counts = sorted(user_message_counts.items(), key=lambda x:x[1]) sorted_message_counts = sorted(user_message_counts.items(), key=lambda x:x[1])
sorted_dict = dict(sorted_message_counts[-limit::]) sorted_dict = dict(sorted_message_counts[-limit::])