Skip to content

Commit

Permalink
prevent cache getting stuck.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapppa committed Sep 8, 2023
1 parent 3294423 commit d4daf95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chiya/cogs/listeners/joyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent) ->

if (
not self.check_emoji(payload.emoji, payload.guild_id)
or cache_data in self.cache["remove"]
or cache_data in self.cache["add"]
):
return

self.cache["remove"].add(cache_data)

channel = self.bot.get_channel(payload.channel_id)

if (
Expand All @@ -96,6 +94,8 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent) ->
):
return

self.cache["add"].add(cache_data)

channel = self.bot.get_channel(payload.channel_id)
message = await channel.fetch_message(payload.message_id)
joy_count = await self.get_joy_count(message)
Expand Down

0 comments on commit d4daf95

Please sign in to comment.