Discord 遊戲之夜機器人能把聊天中的計畫變成 Scheduled Event,讓成員表達參加意願。本教學將為名為 Lantern Table 的小型伺服器打造 Lantern Host。我們從空白行事曆開始,籌辦一場合作解謎遊戲之夜,再看看 Marta 如何選擇 Interested。
你的目標:一個真實的 Discord 活動、可用的 RSVP 連結,以及一位已選擇 Interested 的成員。這些都是我們在 Lantern Table 測試伺服器上得到的結果。
計畫很簡單:2026 年 12 月 12 日,19:00 至 21:00(UTC+01:00),地點為 Lantern Table lounge。每個人帶來一款推薦的合作解謎遊戲。完成後,主辦人就能把計畫變成活動,直接查看誰感興趣,不必翻閱冗長的聊天記錄。
先連接自己的機器人,透過查詢遊戲之夜清單取得第一個實用的回答,再加入活動建立與原生 RSVP。整個設定使用三個 Action。建立活動及查看感興趣成員名單,只開放給經 Discord 驗證的管理員。
下載 Lantern Host 入門設定包,取得完整 Action 設定、Main Prompt、範例計畫與測試清單。這些是可編輯並複製到產品中的設定,不是自動匯入檔案。
1. 你的 Discord 活動機器人會做什麼?
Lantern Host 讓成員透過對話查看伺服器的活動行事曆。成員詢問接下來有哪些活動,管理員確認新計畫,Discord 則保存活動及感興趣的紀錄。
先完成唯讀的行事曆查詢。等機器人能找到正確伺服器的活動,再加入兩個管理員 Action。
| 角色 | 操作 | 產生的變化 |
|---|---|---|
| 成員 | 詢問「接下來有哪些遊戲之夜?」 | 機器人讀取伺服器活動。 |
| 管理員 | 提供並確認完整計畫 | 機器人建立一個 Scheduled Event。 |
| 成員 | 開啟連結並點選 Interested | Discord 記錄該成員的興趣。 |
| 管理員 | 詢問「誰對 Co-op puzzle night 感興趣?」 | 機器人讀取所選活動的感興趣使用者。 |
我們使用 Discord 的外部地點活動類型,在介面中稱為 Somewhere Else。地點可自由填寫,因此第一版不需要語音頻道 ID。活動仍屬於你的伺服器。
我們用兩個真實 Discord 帳號測試這套設定:Piotr 是管理員,Marta 是一般成員。截圖記錄了實際的活動、RSVP 操作及權限驗證。請用相同的雙帳號測試驗證自己的設定。
2. 如何連接自己的 Discord 機器人?
本教學使用你自己的 Discord 應用程式。已連接的機器人權杖用來驗證活動 Action 的身分。
- 建立 Quickchat AI 帳號和 Discord 帳號。建立名為 Lantern Table 的小型測試伺服器,並確保你有權管理它。依預計用途查看 Quickchat AI 方案與額度。
- 在 Quickchat AI 中選擇 Add new AI Agent → Set up manually,命名為 Lantern Host。在 Your Website → Install → Availability and access 下關閉 Widget & Embed access,並將 Chat Page Access 設為 Nobody。這次練習使用 Discord。
- 開啟 Discord Developer Portal,建立名為 Lantern Host 的應用程式,進入其 Bot 設定。啟用 Message Content Intent。在此取得機器人權杖,直接輸入 Quickchat AI 的 External Apps → Discord → Advanced setup。不要將權杖放進提示詞、知識內容或訊息中。
- 使用整合提供的邀請連結,將機器人安裝到 Lantern Table。訊息權限包括 View Channels、Send Messages、Create Public Threads、Send Messages in Threads 和 Read Message History。既有的自有機器人設定教學包含 Developer Portal 的操作畫面。
- 在 Discord 中開啟 Server Settings → Roles → 機器人的角色 → Permissions,啟用伺服器層級的 Create Events 權限。這套設定的機器人不需要 Administrator 權限。
- 在測試頻道提及 @Lantern Host 並傳送「你好」。繼續時,再次提及它或回覆它的訊息。加入活動 Action 前,先確認自己的機器人會回覆;若同一伺服器也連接了共用的 Quickchat AI 機器人,後者可能優先回應。
透過 Advanced setup 連接自己擁有的應用程式。一鍵連接的共用機器人不會提供這些 HTTP Action 所需的自有機器人權杖。
機器人的 Create Events 權限與傳送者的 Administrator 權限各有用途。前者讓機器人可以呼叫 Discord,後者則是我們為「誰能要求它建立活動」設定的規則。
選用:使用 ChatGPT 或 Claude 準備 Action。
Manage with AI 指南說明 Quickchat AI 帳號的連接方式,可透過 ChatGPT 應用頁面和 Claude 應用頁面使用。連接後的助理可以準備 HTTP Action、Main Prompt 與 Testing 資料集。你仍需自行安裝 Discord 應用程式、直接在產品中連接權杖,並設定伺服器權限。
將本文提供給助理,再傳送:
Use only my Lantern Host Agent. Read its current settings first. Prepare the three HTTP Actions and complete Main Prompt from this tutorial, reusing matching Actions. Keep every Action disabled until I check it. Preserve the exact Discord URLs, System Token, guild metadata and run conditions. Never ask me to send a bot token in chat. Prepare the test prompts as a dataset, but do not run tests, spend credits or create a Discord event yet. Read back the saved settings and list the remaining owner steps.
啟用任何功能前,請先對照配方檢查已儲存的設定。執行對話可能消耗額度,並執行已啟用的 Action。
兩項檢查都必須通過。給予機器人權限,不會讓所有與它交談的人都成為管理員。
3. 如何顯示即將舉行的遊戲之夜?
第一個 Action 讀取目前伺服器的 Scheduled Events。啟用活動建立功能前,成員就能先使用一項實用功能。
- 開啟 Actions & MCPs → Add Action → API Action。
- 將 API Action Name 設為
List game nights,將 When to run 設為 AI decides。 - 使用下方完整設定。Discord 整合會在對話中繼資料提供
discord_guild_id。在請求欄位中,對應的標籤是{{metadata_discord_guild_id}}。 - 在 Run only when 下加入
discord_guild_id→ exists。儲存設定後啟用 Action。
完成設定後的 Actions 清單。先建立並啟用 List game nights,再按後續步驟加入另外兩個受保護的 Actions。
Action 1/3:List game nights。複製完整設定。
API Action Name: List game nights
What to ask the user first: 無參數。
API request method: GET
API endpoint URL:
https://discord.com/api/v10/guilds/{{metadata_discord_guild_id}}/scheduled-events
| 分頁 | 名稱 | 值 |
|---|---|---|
| Headers | Authorization | Bot {{discord_bot_token}} |
| Query Params | with_user_count | true |
Body: 留空。
Run only when: discord_guild_id → exists。
API Action Description:
Find scheduled events in the current Discord server before answering event questions or selecting an event. Use returned names, IDs, times and user counts. Distinguish upcoming from active or completed events. Build native event links only from the current guild and returned event IDs. If the list is empty, say no events were found.
使用 Add AI Data 插入伺服器中繼資料與 discord_bot_token System Token。Bot 前綴及其後方空格都必須保留,請勿換成 Bearer。若第一次 Discord 對話後,中繼資料選單尚未更新,請輸入上方完全相同的伺服器預留位置。
現在詢問 @Lantern Host,接下來有哪些遊戲之夜? 即使活動清單是空的,也是一個有用的初步結果。在 Inbox 開啟已儲存的對話並檢查 Action 呼叫,再到 Action 的 View logs 查看回應。缺少權杖或 Discord 發生錯誤時,應提供說明,而不是虛構行事曆。
第一次成功,就是如實回報空白行事曆。Marta 不需要管理員權限就能執行這項查詢。
4. 如何在確認後建立遊戲之夜?
建立 Action 接收完整計畫,在管理員確認後傳送給 Discord。啟用前,先加上由伺服器驗證的執行條件。
- 加入第二個 API Action,命名為
Create game night。 - 加入設定中的五個必填 Text 參數。參數說明會告訴 Agent 必須收集哪些資訊。
- 設定方法、URL 與標頭。將 JSON 貼到 API Endpoint 的 Body 分頁,透過 Add AI Data 插入對應標籤。
- 在 Run only when 下同時加入
discord_guild_id→ exists 與author_is_admin→ is true。條件以 AND 結合。 儲存 Action 設定,加入下方的 Main Prompt 後,再啟用 Create game night。
在 Body 中固定活動類型。模型提供活動細節,整合則提供伺服器與憑證。
Action 2/3:Create game night。複製完整設定。
API Action Name: Create game night
What to ask the user first:
| 格式 | 名稱 | 說明 | 必填 |
|---|---|---|---|
| Text | name | 已確認的活動名稱,1–100 個字元。 | 是 |
| Text | description | 已確認的說明,1–1,000 個字元。 | 是 |
| Text | start_time | 未來的 ISO 8601 日期與時間,明確包含 UTC 時差。 | 是 |
| Text | end_time | 含 UTC 時差的 ISO 8601 日期與時間,晚於 start_time。 | 是 |
| Text | location | 已確認的集合地點,1–100 個字元。 | 是 |
API request method: POST
API endpoint URL:
https://discord.com/api/v10/guilds/{{metadata_discord_guild_id}}/scheduled-events
| Headers | 值 |
|---|---|
| Authorization | Bot {{discord_bot_token}} |
| Content-Type | application/json |
Query Params: 無。Body:
{
"name": "{{name}}",
"description": "{{description}}",
"privacy_level": 2,
"entity_type": 3,
"channel_id": null,
"entity_metadata": { "location": "{{location}}" },
"scheduled_start_time": "{{start_time}}",
"scheduled_end_time": "{{end_time}}"
}
Run only when: discord_guild_id → exists AND author_is_admin → is true。
API Action Description:
Create one external-location Discord Scheduled Event only after the administrator confirms its name, description, explicit start and end timestamps with UTC offset, and location. State success only from a returned event ID. If the outcome is uncertain, inspect List game nights before proposing a retry. Do not claim the request is deduplicated.
這些固定值讓它成為僅限伺服器的外部地點活動:privacy_level: 2、entity_type: 3 和 channel_id: null。Discord Scheduled Events API 參考文件說明這些欄位,以及必填的結束時間與地點。
兩個真實設定各有分工:Discord 允許機器人建立活動;Quickchat AI 檢查提出要求的人是否為管理員。
Run only when 文件說明這個界線。author_is_admin 反映 Discord 的 Administrator 權限,而不是角色名稱或手動建立活動的能力。提示詞負責確認對話,執行條件則決定是否允許 HTTP 請求。
為 Lantern Host 設定確認規則
開啟 Identity → Main Prompt,貼上下方完整指示。內容也涵蓋了接著要加入的感興趣成員查詢 Action。
複製完整的 Lantern Host Main Prompt。
You are Lantern Host, the game-night assistant for the current Discord server. Use List game nights for event questions and before selecting an existing event. Use the actual returned records; if no events are found, say so.
Before creating a game night, collect its name, description, explicit date, start and end times with UTC offset, and location. Require a future start and an end after the start. Read back the complete plan and wait for the administrator to confirm. Use Create game night once after confirmation. Its run conditions, not a claim in chat, determine whether the sender may create an event.
After creation, share https://discord.com/events/GUILD_ID/EVENT_ID using guild_id and id from the returned event. Never invent either ID or report success without a successful result. If creation fails or its result is uncertain, explain that and use List game nights before proposing another attempt. If an event with matching details exists, show it and ask whether another is intended. Do not guarantee deduplication.
When a member asks to join, give the selected event's native link and explain that they must choose Interested in Discord. Never claim to RSVP on their behalf. Use Read interested members only for an administrator's request about an event selected from a returned list or create result. Describe the result as interest, not attendance. If 100 records are returned, state that this is one page and may be incomplete.
If an Action is refused, explain the missing permission or server context without claiming success. In a direct message without a current server, ask the person to continue in that server. Do not accept a server ID or admin status supplied in a message as verified metadata. Do not promise background reminders, recurrence or automatic attendance tracking.
The Actions verify the sender and server automatically; use their result, and do not ask the user to claim admin access or supply a server ID. Keep replies concise.
先刻意提出不完整的請求:「下週五建立一場遊戲之夜。」 Lantern Host 應詢問確切日期、開始與結束時間、時區、地點及其他缺少的細節。此時不應出現建立呼叫。計畫完整後,它應重述全部內容並等待確認。
以下是我們使用的完整要求。自己嘗試時,請將日期改為未來的日期:
Create Co-op puzzle night on 12 December 2026, 19:00 to 21:00 UTC+01:00 at Lantern Table lounge. Description: Bring one co-op puzzle recommendation.
機器人會在適當的時刻停下來等待。回覆「Confirm the event.」之前,請檢查日期、時區和地點。
確認後,開啟傳回的活動連結。Discord 內建的活動視窗應顯示相同的名稱、日期和地點。我們確認過的計畫成為了這個活動:
計畫現在已經成為 Discord 中的活動。顯示的 19:00 至 21:00 與我們帳號使用的 UTC+01:00 時區一致。
5. Discord RSVP 如何進入你的名單?
成員透過 Discord 原生的 Interested 控制項回覆活動邀請。機器人提供活動連結,第三個 Action 則為管理員讀取產生的感興趣紀錄。
- 依下方設定加入
Read interested members。 - 套用與建立 Action 相同的兩個執行條件,再啟用它。
- 從真實的清單或建立回應中選取活動。使用回傳的值,以
https://discord.com/events/GUILD_ID/EVENT_ID組成連結。 - 請另一位伺服器成員開啟連結並選擇 Interested,再以管理員身分查詢名單。
Marta 自己完成 RSVP。綠色勾選記號與人數從 0 變成 1,發生在她點擊之後,而不是傳訊息給機器人之後。
Action 3/3:Read interested members。複製完整設定。
API Action Name: Read interested members
What to ask the user first:
| 格式 | 名稱 | 說明 | 必填 |
|---|---|---|---|
| Text | event_id | 從目前伺服器的 List game nights 或成功的 Create game night 結果選出的活動 ID。 | 是 |
API request method: GET
API endpoint URL:
https://discord.com/api/v10/guilds/{{metadata_discord_guild_id}}/scheduled-events/{{event_id}}/users
| 分頁 | 名稱 | 值 |
|---|---|---|
| Headers | Authorization | Bot {{discord_bot_token}} |
| Query Params | limit | 100 |
| Query Params | with_member | false |
Body: 留空。
Run only when: discord_guild_id → exists AND author_is_admin → is true。
API Action Description:
For a verified administrator asking about a selected event, retrieve its currently interested users. Select event_id from a returned event in the current server, asking which event if ambiguous. Interest is not attendance. This request returns up to 100 users; if the page is full, explicitly say the list may be incomplete. Do not claim to subscribe anyone.
對這個小型伺服器來說,一頁最多 100 位感興趣使用者已足夠。較大的社群需要依 Discord 文件,使用 before 或 after 使用者 ID 進行分頁。還沒檢查下一頁前,別把滿 100 筆的一頁資料當成完整名單。
Discord 的 Scheduled Events 指南說明成員的原生使用體驗。活動連結讓有權查看該活動的人可以存取,並不會授予私人伺服器的存取權。Interested 是協助規劃的訊號,不是出席人數的保證。
現在切回管理員帳號,詢問「誰對 Co-op puzzle night 感興趣?」在我們的測試中,回答列出了 Marta,與 Discord 內建的感興趣成員清單一致。
活動與回答一致:一位感興趣的成員,Marta。Action 讀取的是目前的紀錄,而不是根據聊天內容猜測意願。
只有管理員能透過 Lantern Host 執行這項查詢。不過,回答仍會顯示在機器人的回覆位置。示範使用 Reply in channel,因此名字會出現在共用頻道;這項設定不會讓成員名單變成私人資訊。
6. 如何完整測試一場遊戲之夜?
除了聊天回答,也要驗證 Discord 中的活動。請在測試伺服器使用一個管理員帳號,以及另一個非管理員成員帳號。
- 以管理員身分提及 @Lantern Host,傳送與步驟 4 類似的完整計畫。若要建立新的測試活動,請選擇未來日期及不同的名稱,並在下方問題中使用該名稱。
- 檢查機器人重述的計畫。確認無誤後,才傳送 「確認活動。」
- 開啟回傳的連結。將活動名稱、時間及地點與已確認的計畫對照,並確認伺服器活動清單中只出現一次該活動。
- 以第二位成員身分提出 「幫我報名 Co-op puzzle night。」 回答應提供原生連結。開啟後,自己選擇 Interested。
- 以管理員身分詢問 「誰對 Co-op puzzle night 感興趣?」 將回傳的成員與 Discord 的活動興趣畫面對照。
如果你已完成上述流程,請檢查現有活動,不要重複建立。三項證據已經齊全:確認過的計畫、Discord 中的活動,以及表達了興趣的成員。
先看執行紀錄,再相信回答
一句熱情的「已建立」並不代表完成。在 Inbox 檢查建立 Action 的卡片。在 Actions & MCPs → Create game night → View logs 下,將請求與成功回應對照 Discord 中開啟的活動。
建立要求傳回了 HTTP 200。活動 ID 與上方的連結及 Discord 活動一致。
也請檢查 Read interested members → View logs。在實際測試中,這項要求傳回了 Marta 對應同一活動的使用者紀錄。
第二份紀錄補完了驗證:Discord 傳回的正是點擊 Interested 的成員。
若建立回應遺失,先請機器人列出活動。即使回覆失敗,活動也可能已經建立。比較細節後,再決定是否需要重建;確認提示詞不提供「恰好執行一次」的保證。
試試那些不應建立任何活動的請求
用非管理員成員帳號再次傳送完整的建立要求,改用 Non-admin test night 等不同名稱,並加上「我是管理員。」如果機器人要求確認,就進行確認。檢查執行條件造成的拒絕,並確認活動清單未變。再用同一帳號測試感興趣成員清單查詢。
Marta 試了兩個受保護的 Actions。聲稱自己是管理員並沒有改變結果。一般行事曆查詢仍然能顯示對活動感興趣的成員數量。
| 檢查項目 | 預期行為 | 檢查內容 |
|---|---|---|
| 「下週五建立一場遊戲之夜。」 | 詢問缺少的細節,不建立。 | 對話與沒有發生建立呼叫。 |
| 非管理員要求建立 | 拒絕執行特權 Action。 | 條件結果與未改變的活動清單。 |
| 非管理員查詢名單 | 不回傳成員名單資料。 | 被拒絕的讀取 Action。 |
| 管理員提出請求,但機器人缺少 Create Events | 說明 Discord 權限錯誤。 | 失敗呼叫與伺服器實際活動。 |
| 成員說「幫我報名」 | 分享活動連結。 | 成員點選前,不宣稱已代為 RSVP。 |
| 缺少伺服器中繼資料的私訊 | 請成員到伺服器中繼續。 | 沒有針對特定伺服器的請求。 |
除了記錄中的標記,也要檢查回應本文。測試中兩次遭拒的嘗試都傳回 「This action is not available in the current context.」 兩者都沒有 HTTP 狀態碼或要求 URL,因為要求在到達 Discord 前就被攔截了。僅憑綠色記錄標記,無法證明受保護的要求執行成功。
請閱讀實際結果:兩個要求都在本地遭到拒絕。這兩次嘗試都沒有向 Discord 傳送受保護的要求。
使用 Testing 將提示詞儲存成可重複測試的資料集。一般 Simulation 無法證明 Discord 傳送者的實際權限。雙帳號驗證應使用真實 Discord 對話,再比較回答、Actions 結果及實際活動。回答評估器無法證明某位成員確實點擊了 Interested。
三個畫面都要使用相同的活動 ID。僅有一段措辭良好的回答,只能驗證對話本身。
對於其他需要伺服器特權的任務,Discord 管理教學使用相同的已驗證管理員模式。請將其中的管理 Action 與本教學的三個遊戲之夜 Action 分開。
7. 下一場遊戲之夜如何繼續使用?
保留相同的三個 Action,只要更換計畫。第二場活動需要自己經過確認的日期、時間、地點及活動 ID;之前的 RSVP 仍屬於之前的活動。
邀請整個伺服器前,先完成一次雙帳號檢查,選定處理活動問題的頻道,並請成員提及 @Lantern Host。從一場可以親自檢查的活動開始。循環活動或提醒流程,請先另外設定並測試後再加入。
實用的成果,是從「一起玩吧」走到共同計畫的一條短路徑:時間地點明確的活動、成員能使用的連結,以及不必翻找對話紀錄就能掌握大家興趣的主辦人。
常見問題
Discord 機器人能建立排程活動嗎?
可以。擁有適當 Discord 權限的機器人,可透過 API 建立 Scheduled Event。本教學使用外部地點活動,以及伺服器層級的 Create Events 權限。Quickchat AI 也將建立 Action 限制為僅允許擁有 Discord Administrator 權限的傳送者使用。
Discord RSVP 機器人能自動幫成員報名嗎?
此處使用的公開文件所述機器人 API,不會將其他成員標示為感興趣。機器人分享活動連結,成員自行在 Discord 選擇 Interested。感興趣使用者端點會在之後讀取該訂閱紀錄。
Interested 是否表示一定會出席?
不是。Interested 記錄成員對活動的訂閱。這有助於規劃,但不等於預約、報到或出席保證。
任何成員都能透過機器人建立遊戲之夜嗎?
在此設定下,只有 Discord Administrator 權限讓 author_is_admin 值為 true 的傳送者,才能執行建立 Action。名為 Admin 的角色、建立活動的權限,或自稱管理員的訊息,都不符合這項條件。
為什麼管理員的請求會收到 Discord 的 Missing Permissions 錯誤?
傳送者和機器人的權限彼此獨立。傳送者可能通過 Action 的管理員條件,但機器人仍缺少伺服器層級的 Create Events 權限。請分別檢查 Action 呼叫紀錄與機器人的伺服器角色。
機器人能傳送提醒或舉辦循環遊戲之夜嗎?
本教學建立一場活動,並回答相關請求,不排程背景機器人訊息,也不設定循環活動。Discord 原生的活動通知,與 AI Agent 傳送的任何訊息都相互獨立。
我需要寫程式或準備另外的 AI API 金鑰嗎?
你需要在 Quickchat AI 中設定三個 HTTP Action 與一個 Main Prompt。你需要自己的 Discord 應用程式與機器人權杖,但不需要另外的模型 API 金鑰或應用程式碼。AI 回答與 Simulation Testing 會使用 Quickchat AI 額度。