mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2026-02-28 02:14:22 +00:00
🐛 修复 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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user