Skip to content

Commit

Permalink
Fixing more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeyUsersREC committed Jan 19, 2024
1 parent 62a306c commit db9cb58
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions cogs/ShiftLogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,18 @@ async def load_leaderboard(shift_type=None, batch_size=25):
traceback.print_exc()

if not leaderboard:
await _ctx.send(embed=discord.Embed(
title="No Data",
description="There is no data in this leaderboard.",
color=BLANK_COLOR
))
if msg is not None:
await msg.edit(embed=discord.Embed(
title="No Data",
description="There is no data in this leaderboard.",
color=BLANK_COLOR
), view=None)
else:
await ctx.send(embed=discord.Embed(
title="No Data",
description="There is no data in this leaderboard.",
color=BLANK_COLOR
))
return None
else:
return leaderboard
Expand All @@ -847,8 +854,8 @@ async def load_leaderboard(shift_type=None, batch_size=25):


for index, item in enumerate(all_staff):
if item.get('moderations') == 0:
item['moderations'] = await self.bot.punishments.db.count_documents({"ModeratorID": item['id'], "Guild": ctx.guild.id, "Epoch": {"$gt": item['lowest_time']}})
if item.get('moderations') in [None, 0]:
item['moderations'] = await self.bot.punishments.db.count_documents({"ModeratorID": item['user_id'], "Guild": ctx.guild.id, "Epoch": {"$gt": item['lowest_time']}})
all_staff[index] = item


Expand Down

0 comments on commit db9cb58

Please sign in to comment.