feat: 增加被@后等待下文的逻辑,并优化表情包描述提示

pull/170/head
XBC_D2O 2025-03-10 23:19:46 +08:00
parent ef561b5cf0
commit dea22d849d
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import time
from random import random
import asyncio
from loguru import logger
from nonebot.adapters.onebot.v11 import Bot, GroupMessageEvent
@ -88,6 +89,12 @@ class ChatBot:
await self.storage.store_message(message, topic[0] if topic else None)
is_mentioned = is_mentioned_bot_in_txt(message.processed_plain_text)
if is_mentioned:
#如果被@等待下文10秒
await asyncio.sleep(10)
logger.info(f"被@,等待下文")
reply_probability = willing_manager.change_reply_willing_received(
event.group_id,
topic[0] if topic else None,

View File

@ -177,7 +177,7 @@ class EmojiManager:
async def _get_emoji_discription(self, image_base64: str) -> str:
"""获取表情包的标签"""
try:
prompt = '这是一个表情包,使用中文简洁的描述一下表情包的内容和表情包所表达的情感'
prompt = '这是一个表情包,使用中文简洁的描述一下表情包的内容、上面的文字和表情包所表达的情感'
content, _ = await self.vlm.generate_response_for_image(prompt, image_base64)
logger.debug(f"输出描述: {content}")