mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 03:15:06 +08:00
31 lines
945 B
Python
31 lines
945 B
Python
from .. import aamgr
|
|
|
|
|
|
@aamgr.AbstractCommandNode.register(
|
|
parent=None,
|
|
name="resend",
|
|
description="重新获取上一次问题的回复",
|
|
usage="!resend",
|
|
aliases=[],
|
|
privilege=1
|
|
)
|
|
class ResendCommand(aamgr.AbstractCommandNode):
|
|
@classmethod
|
|
def process(cls, ctx: aamgr.Context) -> tuple[bool, list]:
|
|
from ....openai import session as openai_session
|
|
from ....utils import context
|
|
from ....qqbot import message
|
|
import config
|
|
session_name = ctx.session_name
|
|
reply = []
|
|
|
|
session = openai_session.get_session(session_name)
|
|
to_send = session.undo()
|
|
|
|
mgr = context.get_qqbot_manager()
|
|
|
|
reply = message.process_normal_message(to_send, mgr, config,
|
|
ctx.launcher_type, ctx.launcher_id,
|
|
ctx.sender_id)
|
|
|
|
return True, reply |