Closed HuanLinOTO closed 1 year ago
I think we can modify the assignee to implement this function without any new feature 我认为目前其实可以修改assignee来达到这个效果,不需要增加新功能
Refered from koishi docs: 引用自Koishi文档:
频道数据的 assignee 字段被称为 代理者,其中存储了负责该频道的机器人在对应平台的用户编号。当这个值与一个机器人无法匹配时,Koishi 会限制该机器人对该频道内信息的处理。这听起来可能有点奇怪,不过请想象一下当你的多个机器人同时加了一个频道时,一旦稍有不慎就可能导致这些机器人多次响应同一个输入,甚至可能导致循环触发等严重的后果。
当然,即使机器人的用户编号与频道的代理者编号不匹配,通过 @ 机器人的方式调用指令仍然是安全的和被 Koishi 允许的。代理者机制可以确保 Koishi 管理的同源机器人中同时最多只有一个会响应来自其所在群的信息。
I think you can add bots once. When any bot was unavailable,you can change it at asignee
field automaticlly
我认为你可以一次性添加多个机器人,如果某个机器人发生风控可以使用自动化切换asignee
If you did not need automazion , you can also use the asignee command. 如果你不需要自动化,你也可以使用asignee命令
The document for asignee command: Asignee 命令的文档: https://koishi.chat/plugins/accessibility/admin.html#%E6%8C%87%E4%BB%A4-assign
https://github.com/satorijs/satori/commit/a3b09a46e8721722f102a6f4ff142a7c2d98d879
@Seidko errorly closed this issue due to the commit that @9cats pushed the above that includes close koishijs/koishi#886
which is linked to this issue, and that commit originally aimed to fix #866 issue, which happens in satori repository : https://github.com/satorijs/satori/pull/52
@9cats should be blamed (二度) and @Seidko is innocent.
https://github.com/satorijs/satori/commit/a3b09a46e8721722f102a6f4ff142a7c2d98d879
@Seidko 错误地关闭了这个议题因为@9cats的提交在上面,包含了关闭koishijs/koishi#886
那个连结到这个议题,而那个提交本来目的是修复#866,在悟的仓库里发生: https://github.com/satorijs/satori/pull/52
@9cats 应该被谴责 (再次) 而且 @Seidko 是无辜的。
我想要在一个号风控后通过命令的方式禁用掉当前的onebot插件 然后打开下一个onebot
这个不是命令的方式吧?是通过 API 调用的方式?
我想要在一个号风控后通过命令的方式禁用掉当前的onebot插件 然后打开下一个onebot
这个不是命令的方式吧?是通过 API 调用的方式?
这个功能其实很有用,因为频道里面一般会有专门的机器人频道,所以需要控制哪些命令在哪些频道能响应。不知道有插件可以实现吗?另外,这种功能我觉得更像是官方功能。
我想要在一个号风控后通过命令的方式禁用掉当前的onebot插件 然后打开下一个onebot
这个不是命令的方式吧?是通过 API 调用的方式?
确实 当时开 issue 的时候不了解专业术语(
所以这个有无必要
我看到 TimeBather 提及了
我认为你可以一次性添加多个机器人,如果某个机器人发生风控可以使用自动化切换asignee
但我无法判断是否风控
我想要在一个号风控后通过命令的方式禁用掉当前的onebot插件 然后打开下一个onebot
这个不是命令的方式吧?是通过 API 调用的方式?
这个功能其实很有用,因为频道里面一般会有专门的机器人频道,所以需要控制哪些命令在哪些频道能响应。不知道有插件可以实现吗?另外,这种功能我觉得更像是官方功能。
assignee 功能或许符合你的需求
assignee
请问这是个插件吗
assignee
请问这是个插件吗
是的 它或许藏在admin中
assignee
请问这是个插件吗
是的 它或许藏在admin中
这个assging是不是全部命令都不响应
Non, the assign
command works when you have multiple robots in the same guild, that you could choose one of them to respond to the command, and others would just ignore the invoking.
不,当你在同一个公会中有多个机器人时,assign
命令起作用,你可以选择其中一个来响应命令,而其他人将忽略调用。
As you could invoke session.execute()
to invoke any commands, it is simple for you to just call session.execute('assign ' + botId)
to change the assignee on the fly.
正如你可以 调用 session.execute()
来调用任何命令一样,你只需调用 session. execute('assign ' + botId)
以在飞行时更改受让人。
As you could invoke
session.execute()
to invoke any commands, it is simple for you to just callsession.execute('assign ' + botId)
to change the assignee on the fly.正如你可以 调用
session.execute()
来调用任何命令一样,你只需调用session. execute('assign ' + botId)
以在飞行时更改受让人。
请问如果我想让一个插件里面的若干指令只在某频道响应,怎么做比较好
请问如果我想让一个插件里面的若干指令只在某频道响应,怎么做比较好
是说其他指令不受影响吗?能说说具体的使用例吗?
我推荐不在插件侧编写任何额外的代码,通过过滤器配置来实现。
请问如果我想让一个插件里面的若干指令只在某频道响应,怎么做比较好
是说其他指令不受影响吗?能说说具体的使用例吗?
目前过滤器是针对整个插件是否响应,不太符合我的需要 比如我的插件有10个指令,我想其中5个在A频道响应,另外5个在B频道响应
那么为什么不发两个插件呢?
我认为对用户来说,只要存在这种细粒度的控制,发两个插件就一定是更好的。如果有数据通信还可以发第三个插件,提供一个服务。
那么为什么不发两个插件呢?
也不是不行,只是这10个功能都是同一个主题,互相辅助的功能,如果有用户只装了其中一个可能会有点问题
之后可能会出一种叫过滤器配置项的东西,允许插件将过滤器作为配置项的一部分,这样你可以用两个配置项实现两个过滤器,然后在插件内部去通过过滤器控制不同指令的行为。不过估计还需要一段时间才会出。
毕竟我没有看过你的代码,很难给出最贴合实际需求的解决方案。对我来说,过滤器配置项和发多个插件各有适用的场景。
我认为你们可以自己建一栋摩天大楼了, 已经和标题没啥关系了(雾
之后可能会出一种叫过滤器配置项的东西,允许插件将过滤器作为配置项的一部分,这样你可以用两个配置项实现两个过滤器,然后在插件内部去通过过滤器控制不同指令的行为。不过估计还需要一段时间才会出。
没关系,不急,这个功能我感觉不只是编程上的需要,估计普通用户也会有这个需求,可以考虑一下扩展过滤器。
回归主题。这个 issue 本身的需求我认为可以分为两个部分:
个人认为 assignee 切换是一个很有意义的功能,值得专门写一个插件,实现一个 bot 管理池。不仅可以监控风控事件,还可以设计定时切换逻辑。如果觉得此方案可行的话,可以转去 gocqhttp 插件提交 1 相关的 feature request。
之后可能会出一种叫过滤器配置项的东西,允许插件将过滤器作为配置项的一部分,这样你可以用两个配置项实现两个过滤器,然后在插件内部去通过过滤器控制不同指令的行为。不过估计还需要一段时间才会出。
没关系,不急,这个功能我感觉不只是编程上的需要,估计普通用户也会有这个需求,可以考虑一下扩展过滤器。
我觉得过滤器上增加一列command选项应该就可以解决,这样普通用户也能用
我认为你们可以自己建一栋摩天大楼了, 已经和标题没啥关系了(雾
这是因为对 Koishi 的改动必须非常谨慎,能写插件的就不应该去改 Koishi。
我觉得这个 issue 已经可以转 discussion 了。这个 issue 涉及的 X 需求可以单独通过插件来实现。
Describe the problem related to the feature request
号不少 风控的也不少 我想要在一个号风控后通过命令的方式禁用掉当前的onebot插件 然后打开下一个onebot
Describe the solution you'd like
添加一个上下文的api,能够实现禁用插件 启用插件的功能(可在插件配置向用户申请该权
Describe alternatives you've considered
让koishi自动检测gocqhttp的stdout 来实现风控换号?
Additional context
来个伪代码实现