我已经设置了一个到谷歌聊天室的网络挂钩,以便使用谷歌工作表中的数据,使用谷歌脚本发送消息。一切都很好,除了我想让一些文字出现在谷歌聊天室的粗体格式,但我无法这样做。下面是我的代码。有人能建议我如何做这件事吗?
if (localMoneyReceived == 0){
data = "No money has been Received." + String.fromCharCode(10) + "End of report";
}
var data = {
text: data
};
var payload = JSON.stringify(data);
var options = {
method: "POST",
contentType: "application/json; charset=UTF-8",
payload: payload,
muteHttpExceptions: true
};
var webhook = URL;
var response = UrlFetchApp.fetch(webhook, options);所以文本“没有收到钱”,我希望它在谷歌聊天室中显示为粗体。
提前感谢
发布于 2021-04-12 23:42:47
基于谷歌聊天应用程序接口,包装你的消息在*字符,使其粗体。
请参阅Google Chat API消息格式化here
https://stackoverflow.com/questions/67052810
复制相似问题