🐛 修复 get_message_id 被弃用的问题并简单修缮了代码格式 (#32)

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: Akarin~ <60691961+Asankilp@users.noreply.github.com>
This commit is contained in:
Muika
2025-08-16 17:02:32 +08:00
committed by GitHub
parent a18d85d45c
commit 6050fd1f20
6 changed files with 50 additions and 37 deletions

View File

@@ -29,7 +29,7 @@ def debounce(wait):
def wrapper(*args, **kwargs):
nonlocal last_call_time
current_time = time.time()
if (current_time - last_call_time) > wait:
if last_call_time is None or (current_time - last_call_time) > wait:
last_call_time = current_time
return func(*args, **kwargs)
@@ -52,7 +52,7 @@ class CodeModifiedHandler(FileSystemEventHandler):
"""
@debounce(1)
def on_modified(self, event):
def on_modified(self, event: FileSystemEvent):
raise NotImplementedError("on_modified must be implemented")
def on_created(self, event):