ข้อความ Google Chat
พร้อมให้บริการสำหรับส่วนเสริมของ Google Workspace ที่ขยาย Google Chat
const card = CardService.newCardBuilder() .setHeader(CardService.newCardHeader().setTitle("Card Title")) .addSection(CardService.newCardSection() .addWidget(CardService.newTextParagraph().setText("Text paragraph"))) .build(); const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card); const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);
เมธอด
| วิธีการ | ประเภทการแสดงผล | รายละเอียดแบบย่อ |
|---|---|---|
add | Chat | ตั้งค่าการ์ดของข้อความ |
set | Chat | ตั้งค่าข้อความ |
เอกสารโดยละเอียด
add Card With Id(cardWithId)
ตั้งค่าการ์ดของข้อความ
const card = CardService.newCardBuilder() .setHeader(CardService.newCardHeader().setTitle("Card Title")) .addSection(CardService.newCardSection() .addWidget(CardService.newTextParagraph().setText("Text paragraph"))) .build(); const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card); const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);
พารามิเตอร์
| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
card | Card | การ์ดที่มีรหัสที่จะตั้งค่า |
รีเทิร์น
Chat - ออบเจ็กต์นี้สำหรับการเชื่อมโยง
set Text(text)
ตั้งค่าข้อความ
const message = AddOnsResponseService.newChatMessage().setText("Example text");
พารามิเตอร์
| ชื่อ | ประเภท | คำอธิบาย |
|---|---|---|
text | String | ส่วนข้อความของข้อความ |
รีเทิร์น
Chat - ออบเจ็กต์นี้สำหรับการเชื่อมโยง