插件推荐-----poke

目前napcat/Lagrange/llob均支持戳一戳了,而且有大佬做了支持戳一戳的插koishi-plugin-poke

以前一直羡慕别人的mirai的机器人能被戳一戳回复各种表情包和meme图,现在koishi终于可以做到了
接下来分享下怎么做

懒人一键导入在最后

首先poke分两种模式

1.命令执行模式
这个属于最基础的,也就是执行一个你设定的命令,但是仅支持一个,如果你没太高级的需求的话是用这个模式也足够了,比如默认的status,戳一下机器人显示当前koishi所在的服务器状态

2.消息模式(高级玩法)
这个既可以设置让机器人回复固定的内容又可以让机器人执行命令并且此模式可以设定执行命令的概率搭配其他meme表情的玩法就很舒服了
不过建议用原生的命令不要用alias什么的

此模式搭配meme api的玩法极其丰富.
meme api插件:koishi-plugin-memes-api
meme 后端搭建:Home · MeetWq/meme-generator Wiki · GitHub

在此默认你meme搭好或使用小学的emoji表情

首先来看poke插件的使用说明

  1. 使用消息模式随机触发多种命令,可以使用消息组件,例如<execute>status</execute>
  2. 戳一戳事件具有targetId 属性,表示被戳的用户,可以通过<at id={targetId}/> 插入

也就是说戳一戳可以检测到发起戳一戳动作的人和被戳的用户,既userid和targetid
那么举个例子 meme的击剑,需要2个用户那么就可以这样写:
meme generate 击剑 @{userId} @{targetId}
对于仅处理机器人头像的就可以这样写:
meme generate 二次元入口 @{targetId}
对于处理发起戳一戳用户头像的可以这样写:
meme generate rua @{userId}

如果不使用meme而仅使用小学的表情包插件等就可以这样写:
举个例子 白圣女表情包:
execute>白圣女表情包

meme表情包配置一键导入:

[
  {
    "content": "<execute>meme generate rua @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 击剑 @{userId} @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 结婚申请 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 二次元入口 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 上瘾 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 一样 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 一直 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 我永远喜欢 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 防诱拐 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 阿尼亚喜欢 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 鼓掌 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 问问 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 继续干活 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 拍头 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 揍 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 啃 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 高血压 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 波奇手稿 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 咖波画 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 咖波撕 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 咖波蹭 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 咖波说 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 咖波撞 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 舰长 @{userId} @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 追列车 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 兑换券 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 爬 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 群青 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 像样的亲亲 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 恐龙 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 离婚协议 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 我打宿傩 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 关注 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 芙莉莲拿 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 垃圾 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 原神启动 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 锤 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 抱紧 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 抱大腿 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 不文明 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 啾啾 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 凯露指 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 亲 @{userId} @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 敲 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 听音乐 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 看扁 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 米哈游 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 我老婆 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 需要 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 无响应 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 我推的网友 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 拍 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 完美 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 摸 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 捏 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 顶 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 出警 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 警察 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 捣 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 舔 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 打拳 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 举 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 看书 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 滚 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 贴 @{userId} @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 挠头 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 砸 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 踩 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 炖 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 吸 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 精神支柱 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 唐可可举牌 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 嘲讽 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 讲课 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 拿捏 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 想什么 @{targetId}</execute>"
  },
  {
    "content": "<execute>meme generate 丢 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 抛 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 捶 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 捶爆 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 紧贴 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 汤姆嘲笑 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 上坟 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 转 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 搓 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 胡桃平板 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 胡桃放大 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 洗衣机 @{userId}</execute>"
  },
  {
    "content": "<execute>meme generate 最想要的东西 @{targetId}</execute>"
  }
]
2 个赞

什么,现在戳一戳终于能获取用户了吗

2 个赞

是的,用最新版napcat吧快去玩

2 个赞

直接把表情包配置复制到command.content的框里吗?meme插件和后端我都是装好了的

1 个赞


1 个赞

明白!感谢