PaiGram icon indicating copy to clipboard operation
PaiGram copied to clipboard

[Feat]: Auto-register commands to `/help` and bot menu

Open chuangbo opened this issue 3 years ago • 7 comments

请确保您已阅读以上注意事项,并勾选下方的确认框。

  • [X] 我确定这是一个从未被提出和实现过的功能。
  • [X] 我已经在 Issue Tracker 以及 Pull Request 中找过我要提出的功能,没有找到相同功能的ISSUE和PR。
  • [X] 我已知晓并同意,此处仅用于建议新功能。若这个 Issue 是关于其他非主题的问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。
  • [X] 我已知晓并同意,如果我不按照模板提供的指示进行填写,则我的 Issue 可能会被无条件删除。

Feature to be added

It would be great if the paimon bot allows plugins to declare whether or not to register commands to help and bot menu.

chuangbo avatar Oct 12 '22 07:10 chuangbo

又得写轮子告诉 core.bot 是什么命令还有描述,还命令属于哪个·tag。

luoshuijs avatar Oct 12 '22 07:10 luoshuijs

又得写轮子告诉 core.bot 是什么命令还有描述,还命令属于哪个·tag。

如果要这样的话,那就要有一个plugin规范

karakoo avatar Oct 12 '22 07:10 karakoo

是不是可以通过 decorator 实现

@handler(CommandHandler, command="some_command")
@help("指令分类", "指令说明")
@menu("指令说明")
async def some_command(self, update: Update, context: CallbackContext) -> None:
...

chuangbo avatar Oct 12 '22 07:10 chuangbo

我觉得可以直接在 @handler 修饰器上修改,应该没必要弄这么多

luoshuijs avatar Oct 12 '22 07:10 luoshuijs

karakoo 老怎么解决

luoshuijs avatar Oct 12 '22 07:10 luoshuijs

我觉得可以直接在 @handler 修饰器上修改,应该没必要弄这么多

那直接写进 handler.command 吧 都是 CommandHandler

karakoo avatar Oct 12 '22 07:10 karakoo

#228

luoshuijs avatar Oct 27 '22 14:10 luoshuijs