简体   繁体   English

Python Telegram Bot 设置长长的命令列表

[英]Python Telegram Bot set long list of commands

I'd like to add a long list of commands to my Telegram Bot , however in BotFather I can only send a list of commands and descriptions in a text with up to 4,000 characters.我想向我的Telegram Bot添加一长串命令,但是在BotFather中,我只能以最多 4,000 个字符的文本发送命令和描述列表。 If I send the remainder of the commands via another text, the previous list of commands gets deleted, since BotFather thinks this is the "new" list.如果我通过另一个文本发送剩余的命令,则先前的命令列表将被删除,因为 BotFather 认为这是“新”列表。

Is there a way to set up commands with descriptions directly in my Python script, so that these can be visible to users when typing the /commands in the chat?有没有办法直接在我的Python脚本中设置带有描述的命令,以便用户在聊天中键入 /commands 时可以看到这些命令?

Otherwise, is it possible to set commands in bulk in BotFather without using the chat?否则,是否可以在不使用聊天的情况下在 BotFath 中批量设置命令?

Commands lists are limited by design, the point is not to provide a list of every command your bot is capable of handling, but only suggesting the most usual ones.命令列表受设计限制,重点不是提供您的机器人能够处理的每个命令的列表,而只是建议最常用的命令。

Is there a way to set up commands with descriptions directly in my Python script, so that these can be visible to users when typing the /commands in the chat?有没有办法直接在我的 Python 脚本中设置带有描述的命令,以便用户在聊天中键入 /commands 时可以看到这些命令?

You can automate your own account to send messages and commands to BotFather and thus automate changing your bot's commands list.您可以自动化您自己的帐户以向BotFather发送消息和命令,从而自动更改您的机器人的命令列表。 Telethon , for instance, allows you to do this.例如, Telethon允许您执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM