feat: 整合开发历史
This commit is contained in:
@@ -29,18 +29,26 @@ async def handle_echo(bot: Bot, event: MessageEvent, args: list[str]):
|
||||
|
||||
await event.reply(reply_msg)
|
||||
|
||||
@matcher.command("赞我")
|
||||
async def handle_poke(bot: Bot, event: MessageEvent, args: list[str]):
|
||||
@matcher.command(
|
||||
"赞我",
|
||||
permission=MessageEvent.ADMIN,
|
||||
override_permission_check=True
|
||||
)
|
||||
async def handle_poke(bot: Bot, event: MessageEvent, permission_granted: bool):
|
||||
"""
|
||||
处理 赞我 指令,发送点赞
|
||||
|
||||
:param bot: Bot 实例
|
||||
:param event: 消息事件对象
|
||||
:param args: 指令参数列表(本指令不使用参数)
|
||||
:param permission_granted: 权限检查结果
|
||||
"""
|
||||
if not permission_granted:
|
||||
await event.reply("只有我的操作员才能让我点赞哦!(。•ˇ‸ˇ•。)")
|
||||
return
|
||||
|
||||
try:
|
||||
# 尝试发送赞
|
||||
await bot.send_like(event.user_id, times=10)
|
||||
await event.reply("戳一戳发送成功!")
|
||||
await event.reply("好感度+10!(〃'▽'〃)")
|
||||
except Exception as e:
|
||||
await event.reply(f"戳一戳发送失败:{str(e)}")
|
||||
await event.reply(f"点赞失败了 >_<: {str(e)}")
|
||||
Reference in New Issue
Block a user