feat: 优化表情包插件和 TTS 插件的异步调用,简化错误处理逻辑
This commit is contained in:
@@ -84,10 +84,7 @@ class HelloWorldPlugin(MaiBotPlugin):
|
||||
@Command("random_emojis", description="发送多张随机表情包", pattern=r"^/random_emojis$")
|
||||
async def handle_random_emojis(self, stream_id: str = "", **kwargs):
|
||||
"""发送多张随机表情包"""
|
||||
result = await self.ctx.emoji.get_random(5)
|
||||
if not result or not result.get("success"):
|
||||
return False, "未找到表情包", False
|
||||
emojis = result.get("emojis", [])
|
||||
emojis = await self.ctx.emoji.get_random(5)
|
||||
if not emojis:
|
||||
return False, "未找到表情包", False
|
||||
# 用转发消息发送多张图片
|
||||
|
||||
Reference in New Issue
Block a user