bots.business - 如何使用内嵌键盘向 Bots.Business 中的所有用户广播消息?
问题描述
如何使用内联键盘向所有用户广播消息?
我有这样的代码:
Bot.sendMessage("Hello")
我想:
- 将内联键盘添加到该消息
- 向所有用户广播
解决方案
命令:“/消息”
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")
推荐阅读
- swift - 在 Swift 中录制视频时如何添加叠加层?
- python - 如何每天发出 1 个请求?
- python - SparkSession.conf 和 SparkConf 有什么区别?
- rust - 如何比较两个指针?
- java - 如何构建与包含子字符串中所有字符的任何字符串匹配的正则表达式?
- python - NameError:名称'master'未定义
- c++ - 为什么我无法调用字符串向量的元素来代替字符串?
- java - org.hibernate.LazyInitializationException:未能延迟初始化角色集合:studentsystem2.ikubinfo.entity.Student.classes
- java - 为什么我的标签或按钮都没有出现?
- sql - 如何在 dbGetQuery 函数中正确写入表名?