Mil*_*dem 10 javascript bots node.js telegram-bot telegraf
如何使用telegraf在电报机器人中添加菜单按钮
我通过添加新框架“格莱美”来创建菜单按钮 ”
\n首先安装格莱美:npm install grammy
其次添加此代码:
\nconst { Bot } = require("grammy");\nconst bot = new Bot(BOT_TOKEN); // <-- place your bot token in this string\nRun Code Online (Sandbox Code Playgroud)\n创建命令列表:
\nbot.api.setMyCommands([\n{ command: "start", description: "\xd8\xa5\xd8\xa8\xd8\xaf\xd8\xa3 \xd9\x85\xd9\x86 \xd8\xac\xd8\xaf\xd9\x8a\xd8\xaf" },\n{ command: "help", description: "\xd8\xb7\xd9\x84\xd8\xa8 \xd9\x85\xd8\xb3\xd8\xa7\xd8\xb9\xd8\xaf\xd8\xa9 " },\n{ command: "list", description: "\xd8\xa7\xd9\x84\xd9\x82\xd8\xa7\xd8\xa6\xd9\x85\xd8\xa9 " },\n]);\nRun Code Online (Sandbox Code Playgroud)\n