首页 > 解决方案 > 如何使用内嵌键盘向 Bots.Business 中的所有用户广播消息?

问题描述

如何使用内联键盘向所有用户广播消息?

我有这样的代码:

Bot.sendMessage("Hello")

我想:

标签: bots.business

解决方案


命令:“/消息”

var message = "your text message"
var buttons = [
    {title: "Go to Google", url: "https://google.com"},
    {title: "Call command for Button1", command: "/touch Button1" },
    {title: "Call command for Button2", command: "/touch Button2" }
];

Bot.sendInlineKeyboard(buttons, message);

命令:/广播

// for admin only
if(user.telegramid!="your telegram id"){ return }

Bot.runAll({
  command: "/message"
})

Bot.sendMessage("message will be broadcasted to all chats")

推荐阅读