Skip to content

Commit

Permalink
aoc fix
Browse files Browse the repository at this point in the history
`aoc` now only restarts the loop
  • Loading branch information
Heryin committed Dec 1, 2024
1 parent 5d1270e commit 36df4eb
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions pychan/commands/utilities/aoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,7 @@ async def list(self, ctx: Context):
async def force_update(self, ctx: Context):
'''Wymusza natychmiastowe zaktualizowanie rankingu'''
if self.tracked_channels.get(ctx.channel.id) is not None:
tracked_channel = self.tracked_channels[ctx.channel.id]
data = self.fetch_data(tracked_channel.leaderboard_id)
extracted_data = self.parse_data(data)
rows = self.get_rows(extracted_data)
messages = self.split_message(rows)
for i, msg in enumerate(tracked_channel.messages):
if i < len(messages):
await msg.edit(content=messages[i])
else:
await msg.delete()
for i in range(len(tracked_channel.messages), len(messages)):
new_msg = await tracked_channel.messages[0].channel.send(messages[i])
tracked_channel.messages.append(new_msg)
self.loop.restart()
else:
await ctx.reply("Śledzenie nawet nie jest włączone!")

Expand Down

0 comments on commit 36df4eb

Please sign in to comment.