設計使用者互動方式
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本頁說明 Google Chat 應用程式如何設計及回應與使用者的互動。
聊天應用程式可透過下列部分方式支援互動功能:
- 向使用者介紹 Chat 應用程式
- 回應指令
- 顯示或傳送互動式卡片介面
- 開啟互動式對話方塊
- 預覽連結
- 在訊息中提及使用者
向使用者介紹 Chat 應用程式
透過歡迎訊息,將使用者和聊天室加入 Chat 應用程式,詳細說明 Chat 應用程式的功能,以及使用者如何最佳運用這項服務。
有效的產品新手上路訊息結構如下:
- 打聲招呼。為使用者設定合適的語氣和語調。
- 簡要說明 Chat 應用程式的用途。介紹 Chat 應用程式時,請用一兩句話說明這款應用程式可協助使用者完成哪些操作。
- 告訴觀眾如何開始使用。說明如何使用 Chat 應用程式。如果 Chat 應用程式需要設定或授權,這裡就是提醒使用者完成設定程序的好地方。例如,建議一或兩個常見指令。
- 說明如何取得協助和提供意見回饋。結束訊息時,請告訴使用者如何取得協助或提供意見回饋。
以下是 Chat 應用程式新手上路訊息,可協助使用者順利使用應用程式:
回應指令
指令可讓使用者以特定或可重複的方式提出要求或與 Chat 應用程式互動。使用者可以在訊息中使用指令 (例如輸入 /help
),或是從回覆區的選單中選取指令。
以下是 Cymbal Chat 應用程式可用的指令清單:
在訊息中提及使用者
Chat 應用程式可以在聊天室中@提及特定使用者或所有使用者,通知他們有訊息傳送給他們。在提及單一使用者之前,尤其是在聊天室中提及所有使用者之前,請先考慮是否真的有必要這麼做,並避免提及使用者。
提及單一使用者會導致對方收到通知,並中斷他們正在進行的其他工作。提及聊天室中的所有使用者,會傳送通知給聊天室中的所有成員。如果太常提及使用者,他們可能會對 Chat 應用程式感到厭煩,並開始將其視為垃圾訊息。
但如果是為了處理非常重要或有時效性的事,則可以提及使用者。舉例來說,下列 Chat 應用程式會 @提及一個充滿軟體開發人員的空間,通知他們程式碼凍結期即將到來,並讓他們有機會表示自己需要在截止日期前多一點時間:
另一方面,下列 Chat 應用程式直接向客戶致謝,雖然禮貌,但不值得通知:
傳送或顯示互動式資訊卡
資訊卡是 UI 元素,可包含互動式和靜態小工具,例如文字、圖片和按鈕,Chat 應用程式可將這些元素傳送給使用者和聊天室。如果 Chat 應用程式需要向使用者收集資訊、顯示詳細資訊,或引導使用者採取後續步驟,請傳送資訊卡訊息。
在 Chat 應用程式中,您可以在訊息中傳送資訊卡介面,或是在即時訊息聊天室中將資訊卡顯示為首頁。
使用資訊卡建構工具,設計及預覽 Chat 應用程式的訊息和使用者介面:
開啟資訊卡建立工具
以下是 Chat 應用程式中的資訊卡訊息:
開啟互動式對話方塊
對話方塊是使用者可開啟與 Chat 應用程式互動的窗格式卡片介面。您可以在對話方塊中依序串連多個卡片訊息,協助使用者完成多步驟程序,例如填寫表單資料。
在以下範例中,Chat 應用程式會啟動對話方塊,從發出 /createContact
斜線指令的使用者收集聯絡詳細資料:
Chat 使用者傳送的預覽連結
Chat 擴充應用程式可以為聊天室中的使用者預覽連結。每當有人分享相符的連結時,Chat 應用程式就能在訊息中附加資訊卡,顯示連結相關資訊。
以下 Chat 應用程式可協助客戶服務專員預覽在 Chat 聊天室中分享的案件連結:
後續步驟
如要建構互動式功能,您必須設定 Chat 應用程式來接收互動事件。如需步驟,請參閱接收及回覆 Chat 應用程式的互動內容
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-03-06 (世界標準時間)。
[null,null,["上次更新時間:2025-03-06 (世界標準時間)。"],[[["\u003cp\u003eGoogle Chat apps can enhance user interaction through features like slash commands, interactive cards, and dialogs.\u003c/p\u003e\n"],["\u003cp\u003eOnboarding messages are crucial for introducing your Chat app's functionality and guiding users on how to get started.\u003c/p\u003e\n"],["\u003cp\u003eCards provide a visually engaging way to gather information, display details, and guide users within Chat.\u003c/p\u003e\n"],["\u003cp\u003eDialogs facilitate multi-step processes by enabling sequential card interactions within a dedicated window.\u003c/p\u003e\n"],["\u003cp\u003eChat apps can preview links shared by users, enhancing the context and information associated with them.\u003c/p\u003e\n"]]],["Google Chat apps interact with users by sending welcome messages, responding to slash commands (e.g., `/help`), and using interactive cards for UI. Apps can also open dialogs for multi-step processes, preview shared links with detailed information, and @mention users for important notifications, though overuse should be avoided. Building these interactive features requires the app to be configured to receive interaction events from Google chat.\n"],null,["# Design user interactions\n\nThis page describes how Google Chat apps can design and respond to\ninteractions with users.\n\nChat apps support interactivity in some of the\nfollowing ways:\n\n- Introduce users to your Chat app\n- Respond to commands\n- Display or send interactive card-based interfaces\n- Open interactive dialogs\n- Preview links\n- @mention users in a message\n\nIntroduce users to your Chat app\n--------------------------------\n\nOnboard people and spaces to your Chat app with a\nwelcome message that details what your Chat app does,\nand how people can best work with it.\n\nAn effective onboarding message has the following structure:\n\n- **Say hello**. Set the right voice and tone with your users.\n- **Describe briefly what your Chat app does**. Introduce your Chat app by telling people what it can help them do in one or two sentences.\n- **Tell people how to get started**. Tell people how to work with your Chat app. If your Chat app requires configuration or authorization, this is a good place to prompt people to complete the set-up process. For example, suggest one or two common commands.\n- **Explain how to get help and how to give feedback**. End the message by telling people how they can get help or offer feedback.\n\nThe following Chat app's onboarding message prepares\nusers for success:\n\nRespond to commands\n-------------------\n\n[Commands](/workspace/chat/commands)\nlet users request or interact with your Chat app in\nspecific or repeatable ways. Users can use commands in messages (such as typing\n`/help`), or select them from a menu in the reply area.\n\nThe following is a list of commands available for the Cymbal\nChat app:\n\n@mention users in messages\n--------------------------\n\nYour Chat app can\n[@mention specific users or all users](/workspace/chat/format-messages#messages-@mention)\nin a space to notify them of the message.\nBefore you mention a single user, and especially before you\nmention all users in a space, you should consider whether or not it's really\nnecessary, and err on the side of **not @mentioning people**.\n\nMentioning single users causes them to receive a notification and interrupts\nwhatever else they're doing. Mentioning all users in a space sends a\nnotification to everyone in the space. Mention people too often, and they might\nbecome annoyed with your Chat app and start to view it\nas spam.\n\nIt is OK to mention users for very important or time-sensitive reasons. For\nexample, the following Chat app @mentions a space full\nof software developers to notify them that code freeze is approaching and to\ngive them the chance to say they need a bit more time before the deadline:\n\nOn the other hand, the following Chat app mentions a\ncustomer directly to thank them; which is polite, but not notification-worthy:\n\nSend or display interactive cards\n---------------------------------\n\nCards are UI elements that can contain both interactive and static\nwidgets such as text, images, and buttons that Chat apps can send\nto users and spaces. If your Chat app needs to gather\ninformation from users, present detailed information, or guide users to take a\nnext step, send a card message.\n\nAs a Chat app, you can send card interfaces in\n[messages](/workspace/chat/create-messages#create) or display cards as a\n[homepage](/workspace/chat/send-app-home-card-message) in direct message spaces.\n\n\n*** ** * ** ***\n\nUse the Card Builder to design and preview messaging and user interfaces for Chat apps:\n[Open the Card Builder](https://addons.gsuite.google.com/uikit/builder)\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\nThe following is a card message from a Chat app:\n\n### Open interactive dialogs\n\n[Dialogs](/workspace/chat/dialogs) are windowed, card-based interfaces that a\nuser can open to interact with your Chat app. In\ndialogs, you can string together multiple card messages sequentially, which\nhelps users complete multi-step processes, like filling in\n[form data](/workspace/chat/read-form-data).\n\nIn the following example, a Chat app starts a dialog to\ngather contact details from a user who issues the `/createContact` slash\ncommand:\n\n### Preview links sent by Chat users\n\nChat apps can [preview links](/workspace/chat/preview-links)\nfor users in a space. Whenever someone shares a matching link,\na Chat app can attach a card to their message that\ndisplays information about the link.\n\nThe following Chat app helps customer service agents\npreview links to cases shared in a Chat space:\n\nNext steps\n----------\n\nTo build interactive features, you must configure your\nChat app to receive interaction events. For steps,\n[Receive and respond to interactions with your Chat app](/workspace/chat/receive-respond-interactions)"]]