🐛 修复 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

@ -22,6 +22,7 @@ from nonebot_plugin_alconna.uniseg import (
Text,
UniMessage,
UniMsg,
get_message_id,
get_target,
)
from nonebot_plugin_argot import Argot # type: ignore
@ -57,7 +58,7 @@ class MarshoHandler:
self.event: Event = current_event.get()
# self.state: T_State = current_handler.get().state
self.matcher: Matcher = current_matcher.get()
self.message_id: str = UniMessage.get_message_id(self.event)
self.message_id: str = get_message_id(self.event)
self.target = get_target(self.event)
async def process_user_input(
@ -124,7 +125,7 @@ class MarshoHandler:
async def handle_function_call(
self,
completion: Union[ChatCompletion],
completion: Union[ChatCompletion, AsyncStream[ChatCompletionChunk]],
user_message: Union[str, list],
model_name: str,
tools_list: list | None = None,
@ -248,7 +249,7 @@ class MarshoHandler:
Text(await process_completion_to_details(response)),
command="detail",
expired_at=timedelta(minutes=5),
)
) # type:ignore
)
# send_message.append(
# Argot(