typing和防炸
This commit is contained in:
@@ -739,7 +739,7 @@ class EmojiManager:
|
|||||||
emoji = await self.get_emoji_from_manager(emoji_hash)
|
emoji = await self.get_emoji_from_manager(emoji_hash)
|
||||||
if emoji and emoji.emotion:
|
if emoji and emoji.emotion:
|
||||||
logger.info(f"[缓存命中] 从内存获取表情包描述: {emoji.emotion}...")
|
logger.info(f"[缓存命中] 从内存获取表情包描述: {emoji.emotion}...")
|
||||||
return emoji.emotion
|
return ",".join(emoji.emotion)
|
||||||
|
|
||||||
# 如果内存中没有,从数据库查找
|
# 如果内存中没有,从数据库查找
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def init_prompt():
|
|||||||
{identity_block}
|
{identity_block}
|
||||||
|
|
||||||
{custom_prompt_block}
|
{custom_prompt_block}
|
||||||
{chat_context_description},以下是具体的聊天内容,其中[mxxx]是消息id。
|
{chat_context_description},以下是具体的聊天内容。
|
||||||
{chat_content_block}
|
{chat_content_block}
|
||||||
|
|
||||||
{moderation_prompt}
|
{moderation_prompt}
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ def get_key_comment(toml_table, key):
|
|||||||
return item.trivia.comment
|
return item.trivia.comment
|
||||||
if hasattr(toml_table, "keys"):
|
if hasattr(toml_table, "keys"):
|
||||||
for k in toml_table.keys():
|
for k in toml_table.keys():
|
||||||
if isinstance(k, KeyType) and k.key == key: # type: ignore
|
if isinstance(k, KeyType) and k.key == key: # type: ignore
|
||||||
return k.trivia.comment # type: ignore
|
return k.trivia.comment # type: ignore
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user