refactor: 将多个方法修改为静态方法以提高代码可读性和一致性

This commit is contained in:
春河晴
2025-04-17 15:39:49 +09:00
parent 73da67fce8
commit dc96e26ca5
37 changed files with 248 additions and 174 deletions

View File

@@ -100,7 +100,8 @@ class InfoCatcher:
self.trigger_response_message, first_bot_msg
)
def get_message_from_db_between_msgs(self, message_start: Message, message_end: Message):
@staticmethod
def get_message_from_db_between_msgs(message_start: Message, message_end: Message):
try:
# 从数据库中获取消息的时间戳
time_start = message_start.message_info.time
@@ -155,7 +156,8 @@ class InfoCatcher:
return result
def message_to_dict(self, message):
@staticmethod
def message_to_dict(message):
if not message:
return None
if isinstance(message, dict):