Compare commits

...

2 Commits

Author SHA1 Message Date
41ec25cd21 fix: Caching issue on unfocus 2025-11-01 07:03:30 +10:00
424f7584cb fix: Correct ratelimit for delete notify 2025-11-01 06:58:46 +10:00

View File

@@ -91,8 +91,8 @@ class FocusComponent(cmds.Component):
if hyperfocused and not self.check_hyperfocus_message(payload): if hyperfocused and not self.check_hyperfocus_message(payload):
# If we need to delete, run delete and send message # If we need to delete, run delete and send message
notify = ( # notify = ( #
(last := self._last_deleted.get(profile.profileid)) not (last := self._last_deleted.get(profile.profileid))
and (utc_now() - last).total_seconds() > 30 or (utc_now() - last).total_seconds() > 30
) )
try: try:
await self.focus_delete_message(payload) await self.focus_delete_message(payload)
@@ -168,7 +168,9 @@ class FocusComponent(cmds.Component):
@cmds.command(name="unfocus") @cmds.command(name="unfocus")
async def unfocus_cmd(self, ctx): async def unfocus_cmd(self, ctx):
profile = await self.bot.profiles.fetch_profile(ctx.chatter, touch=True) profile = await self.bot.profiles.fetch_profile(ctx.chatter, touch=True)
row = await Hyperfocuser.table.delete_where(profileid=profile.profileid) row = await Hyperfocuser.fetch(profile.profileid)
if row:
await row.delete()
await ctx.reply( await ctx.reply(
"Welcome back from focus, hope it went well!" "Welcome back from focus, hope it went well!"