Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 tasks done
chuangbo opened this issue Oct 12, 2022 · 7 comments
Open
4 tasks done

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

chuangbo opened this issue Oct 12, 2022 · 7 comments
Labels
enhancement ✨ New feature or request

Comments

@chuangbo
Copy link
Member

chuangbo commented Oct 12, 2022

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

  • 我确定这是一个从未被提出和实现过的功能。
  • 我已经在 Issue Tracker 以及 Pull Request 中找过我要提出的功能,没有找到相同功能的ISSUE和PR。
  • 我已知晓并同意,此处仅用于建议新功能。若这个 Issue 是关于其他非主题的问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。
  • 我已知晓并同意,如果我不按照模板提供的指示进行填写,则我的 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 chuangbo added the enhancement ✨ New feature or request label Oct 12, 2022
@luoshuijs
Copy link
Contributor

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

@karakoo
Copy link
Member

karakoo commented Oct 12, 2022

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

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

@chuangbo
Copy link
Member Author

是不是可以通过 decorator 实现

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

@luoshuijs
Copy link
Contributor

luoshuijs commented Oct 12, 2022

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

@luoshuijs
Copy link
Contributor

karakoo 老怎么解决

@karakoo
Copy link
Member

karakoo commented Oct 12, 2022

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

那直接写进 handler.command
都是 CommandHandler

@luoshuijs
Copy link
Contributor

#228

@chuangbo chuangbo changed the title [Feat]: 自动注册命令到 help 和 bot menu [Feat]: Auto-register commands to /help and bot menu Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants