Skip to content

Commit ded8c8e

Browse files
committed
feat: dispatch event for snoozing/unsnoozing.
This allows plugin developers to create feature on snoozing/unsnoozing.
1 parent df3bffb commit ded8c8e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/thread.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ async def snooze(self, moderator=None, command_used=None, snooze_for=None):
254254
import logging
255255

256256
logging.info(f"[SNOOZE] DB update result: {result.modified_count}")
257+
258+
# Dispatch thread_snoozed event for plugins
259+
self.bot.dispatch("thread_snoozed", self, moderator, snooze_for)
257260

258261
behavior = behavior_pre
259262
if behavior == "move":
@@ -746,6 +749,9 @@ async def _ensure_genesis(force: bool = False):
746749

747750
# Mark unsnooze as complete
748751
self._unsnoozing = False
752+
753+
# Dispatch thread_unsnoozed event for plugins
754+
self.bot.dispatch("thread_unsnoozed", self)
749755

750756
# Process queued commands
751757
await self._process_command_queue()

0 commit comments

Comments
 (0)