Skip to content

Commit 8a9e351

Browse files
shanselmanCopilot
andauthored
Fix Discord bot token configuration (#960)
Co-authored-by: Copilot App <[email protected]>
1 parent 5a18150 commit 8a9e351

8 files changed

Lines changed: 172 additions & 54 deletions

File tree

‎src/OpenClaw.Tray.WinUI/Pages/ChannelsPage.xaml.cs‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ private FrameworkElement BuildBody(ChannelRecord record)
814814
stack.Children.Add(BuildLinkingPlaceholder(record));
815815

816816
// Configuration section — inline credential form for channels we have
817-
// explicit field definitions for (Telegram bot token, Discord webhook,
817+
// explicit field definitions for (Telegram/Discord bot tokens,
818818
// Slack tokens, Google Chat webhook, Nostr key/relays).
819819
//
820820
// For configured channels the section header reads "Replace
@@ -1067,7 +1067,7 @@ private static (string? Text, string? Url) ResolveExternalHelpLink(string channe
10671067
"whatsapp" => (LocalizationHelper.GetString("ChannelsPage_HelpWhatsApp"), "https://faq.whatsapp.com/378279004439436/"),
10681068
"signal" => (LocalizationHelper.GetString("ChannelsPage_HelpSignal"), "https://support.signal.org/hc/en-us/articles/360007320551"),
10691069
"telegram" => (LocalizationHelper.GetString("ChannelsPage_HelpTelegram"), "https://core.telegram.org/bots/features#botfather"),
1070-
"discord" => (LocalizationHelper.GetString("ChannelsPage_HelpDiscord"), "https://support.discord.com/hc/en-us/articles/228383668"),
1070+
"discord" => (LocalizationHelper.GetString("ChannelsPage_HelpDiscord"), "https://discord.com/developers/applications"),
10711071
"googlechat" => (LocalizationHelper.GetString("ChannelsPage_HelpGoogleChat"), "https://developers.google.com/chat/how-tos/webhooks"),
10721072
"slack" => (LocalizationHelper.GetString("ChannelsPage_HelpSlack"), "https://api.slack.com/apps"),
10731073
"nostr" => (LocalizationHelper.GetString("ChannelsPage_HelpNostr"), "https://nostr.com/"),
@@ -1160,7 +1160,7 @@ private sealed record ConfigField(
11601160
/// Per-channel inline-form schema. Fields were validated against the
11611161
/// gateway test fixtures (src/cli/config-cli.test.ts and related tests
11621162
/// confirm channels.telegram.botToken, channels.slack.botToken/signingSecret,
1163-
/// channels.discord.webhookUrl, etc.). Returns null for channels without an
1163+
/// channels.discord.token, etc.). Returns null for channels without an
11641164
/// inline form — those still get the "Open Config page" stub.
11651165
/// </summary>
11661166
private static IReadOnlyList<ConfigField>? ResolveConfigFields(string channelId) =>
@@ -1179,12 +1179,12 @@ private sealed record ConfigField(
11791179
"discord" => new[]
11801180
{
11811181
new ConfigField(
1182-
"channels.discord.webhookUrl",
1183-
LocalizationHelper.GetString("ChannelsPage_FieldWebhookUrl"),
1184-
"https://discord.com/api/webhooks/...",
1182+
"channels.discord.token",
1183+
LocalizationHelper.GetString("ChannelsPage_FieldDiscordBotToken"),
1184+
LocalizationHelper.GetString("ChannelsPage_PlaceholderDiscordBotToken"),
11851185
Sensitive: true,
11861186
Required: true,
1187-
HelpText: LocalizationHelper.GetString("ChannelsPage_HelpWebhookDiscord")),
1187+
HelpText: LocalizationHelper.GetString("ChannelsPage_HelpDiscordBotToken")),
11881188
},
11891189
"googlechat" => new[]
11901190
{
@@ -2357,7 +2357,7 @@ private static IReadOnlyList<string> BuildGenericSubtitleLines(ChannelRecord rec
23572357
{
23582358
"whatsapp" => "Link your phone — scan a QR to connect",
23592359
"telegram" => "Bot integration — paste your bot token to set up",
2360-
"discord" => "Webhook integration — paste a Discord webhook URL",
2360+
"discord" => "Bot integration — paste your Discord bot token",
23612361
"googlechat" => "Webhook integration — paste a Google Chat webhook",
23622362
"slack" => "OAuth app — install a Slack app to connect",
23632363
"signal" => "Link your phone — scan a QR to connect",

‎src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5626,7 +5626,7 @@ Make sure the gateway is running.</value>
56265626
<value>How to create a Telegram bot →</value>
56275627
</data>
56285628
<data name="ChannelsPage_HelpDiscord" xml:space="preserve">
5629-
<value>How to create a Discord webhook →</value>
5629+
<value>How to create a Discord bot →</value>
56305630
</data>
56315631
<data name="ChannelsPage_HelpGoogleChat" xml:space="preserve">
56325632
<value>How to add a Google Chat webhook →</value>
@@ -5680,19 +5680,19 @@ Make sure the gateway is running.</value>
56805680
<value>Click &quot;Save and start&quot;. The channel will start automatically.</value>
56815681
</data>
56825682
<data name="ChannelsPage_GuideDiscordHeadline" xml:space="preserve">
5683-
<value>Connect Discord via a webhook</value>
5683+
<value>Connect Discord via a bot</value>
56845684
</data>
56855685
<data name="ChannelsPage_GuideDiscordStep1" xml:space="preserve">
5686-
<value>Open your Discord server settings → Integrations → Webhooks.</value>
5686+
<value>Open the Discord Developer Portal, then create or select an application.</value>
56875687
</data>
56885688
<data name="ChannelsPage_GuideDiscordStep2" xml:space="preserve">
5689-
<value>Click &quot;New Webhook&quot;, give it a name, and copy the webhook URL.</value>
5689+
<value>Open Bot, add a bot if needed, then reset and copy its token.</value>
56905690
</data>
56915691
<data name="ChannelsPage_GuideDiscordStep3" xml:space="preserve">
5692-
<value>Paste the URL into the Configuration form below.</value>
5692+
<value>Paste the bot token into the Configuration form below.</value>
56935693
</data>
56945694
<data name="ChannelsPage_GuideDiscordStep4" xml:space="preserve">
5695-
<value>Click &quot;Save and start&quot;.</value>
5695+
<value>Click &quot;Save and start&quot;, then add the bot to your server with its OAuth2 installation link.</value>
56965696
</data>
56975697
<data name="ChannelsPage_GuideGoogleChatHeadline" xml:space="preserve">
56985698
<value>Connect Google Chat via a webhook</value>
@@ -5766,6 +5766,12 @@ Make sure the gateway is running.</value>
57665766
<data name="ChannelsPage_FieldBotToken" xml:space="preserve">
57675767
<value>Bot token</value>
57685768
</data>
5769+
<data name="ChannelsPage_FieldDiscordBotToken" xml:space="preserve">
5770+
<value>Discord Bot Token</value>
5771+
</data>
5772+
<data name="ChannelsPage_PlaceholderDiscordBotToken" xml:space="preserve">
5773+
<value>Paste Discord bot token</value>
5774+
</data>
57695775
<data name="ChannelsPage_FieldWebhookUrl" xml:space="preserve">
57705776
<value>Webhook URL</value>
57715777
</data>
@@ -5781,8 +5787,8 @@ Make sure the gateway is running.</value>
57815787
<data name="ChannelsPage_HelpBotToken" xml:space="preserve">
57825788
<value>Get from @BotFather (/newbot).</value>
57835789
</data>
5784-
<data name="ChannelsPage_HelpWebhookDiscord" xml:space="preserve">
5785-
<value>Server Settings → Integrations → Webhooks → New Webhook.</value>
5790+
<data name="ChannelsPage_HelpDiscordBotToken" xml:space="preserve">
5791+
<value>Copy from Discord Developer Portal → Bot → Reset Token.</value>
57865792
</data>
57875793
<data name="ChannelsPage_HelpWebhookGoogleChat" xml:space="preserve">
57885794
<value>Open a space → Manage webhooks → Add webhook.</value>

‎src/OpenClaw.Tray.WinUI/Strings/fr-fr/Resources.resw‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5622,7 +5622,7 @@ Assurez-vous que la passerelle est en cours d'exécution.</value>
56225622
<value>Comment créer un bot Telegram →</value>
56235623
</data>
56245624
<data name="ChannelsPage_HelpDiscord" xml:space="preserve">
5625-
<value>Comment créer un webhook Discord →</value>
5625+
<value>Comment créer un bot Discord →</value>
56265626
</data>
56275627
<data name="ChannelsPage_HelpGoogleChat" xml:space="preserve">
56285628
<value>Comment ajouter un webhook Google Chat →</value>
@@ -5676,19 +5676,19 @@ Assurez-vous que la passerelle est en cours d'exécution.</value>
56765676
<value>Cliquez sur "Save and start". Le canal démarrera automatiquement.</value>
56775677
</data>
56785678
<data name="ChannelsPage_GuideDiscordHeadline" xml:space="preserve">
5679-
<value>Connecter Discord via un webhook</value>
5679+
<value>Connecter Discord via un bot</value>
56805680
</data>
56815681
<data name="ChannelsPage_GuideDiscordStep1" xml:space="preserve">
5682-
<value>Ouvrez les paramètres de votre serveur Discord → Intégrations → Webhooks.</value>
5682+
<value>Ouvrez le portail des développeurs Discord, puis créez ou sélectionnez une application.</value>
56835683
</data>
56845684
<data name="ChannelsPage_GuideDiscordStep2" xml:space="preserve">
5685-
<value>Cliquez sur "New Webhook", donnez-lui un nom et copiez l’URL du webhook.</value>
5685+
<value>Ouvrez Bot, ajoutez un bot si nécessaire, puis réinitialisez et copiez son jeton.</value>
56865686
</data>
56875687
<data name="ChannelsPage_GuideDiscordStep3" xml:space="preserve">
5688-
<value>Collez l’URL dans le formulaire de configuration ci-dessous.</value>
5688+
<value>Collez le jeton du bot dans le formulaire de configuration ci-dessous.</value>
56895689
</data>
56905690
<data name="ChannelsPage_GuideDiscordStep4" xml:space="preserve">
5691-
<value>Cliquez sur "Save and start".</value>
5691+
<value>Cliquez sur "Save and start", puis ajoutez le bot à votre serveur avec son lien d’installation OAuth2.</value>
56925692
</data>
56935693
<data name="ChannelsPage_GuideGoogleChatHeadline" xml:space="preserve">
56945694
<value>Connecter Google Chat via un webhook</value>
@@ -5762,6 +5762,12 @@ Assurez-vous que la passerelle est en cours d'exécution.</value>
57625762
<data name="ChannelsPage_FieldBotToken" xml:space="preserve">
57635763
<value>Jeton du bot</value>
57645764
</data>
5765+
<data name="ChannelsPage_FieldDiscordBotToken" xml:space="preserve">
5766+
<value>Jeton du bot Discord</value>
5767+
</data>
5768+
<data name="ChannelsPage_PlaceholderDiscordBotToken" xml:space="preserve">
5769+
<value>Collez le jeton du bot Discord</value>
5770+
</data>
57655771
<data name="ChannelsPage_FieldWebhookUrl" xml:space="preserve">
57665772
<value>URL du webhook</value>
57675773
</data>
@@ -5777,8 +5783,8 @@ Assurez-vous que la passerelle est en cours d'exécution.</value>
57775783
<data name="ChannelsPage_HelpBotToken" xml:space="preserve">
57785784
<value>Obtenez-le auprès de @BotFather (/newbot).</value>
57795785
</data>
5780-
<data name="ChannelsPage_HelpWebhookDiscord" xml:space="preserve">
5781-
<value>Paramètres du serveur → Intégrations → Webhooks → New Webhook.</value>
5786+
<data name="ChannelsPage_HelpDiscordBotToken" xml:space="preserve">
5787+
<value>Copiez-le depuis le portail des développeurs Discord → Bot → Reset Token.</value>
57825788
</data>
57835789
<data name="ChannelsPage_HelpWebhookGoogleChat" xml:space="preserve">
57845790
<value>Ouvrez un espace → Gérer les webhooks → Ajouter un webhook.</value>

‎src/OpenClaw.Tray.WinUI/Strings/nl-nl/Resources.resw‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5623,7 +5623,7 @@ Controleer of de gateway actief is.</value>
56235623
<value>Een Telegram-bot aanmaken →</value>
56245624
</data>
56255625
<data name="ChannelsPage_HelpDiscord" xml:space="preserve">
5626-
<value>Een Discord-webhook aanmaken →</value>
5626+
<value>Een Discord-bot aanmaken →</value>
56275627
</data>
56285628
<data name="ChannelsPage_HelpGoogleChat" xml:space="preserve">
56295629
<value>Een Google Chat-webhook toevoegen →</value>
@@ -5677,19 +5677,19 @@ Controleer of de gateway actief is.</value>
56775677
<value>Klik op "Save and start". Het kanaal start automatisch.</value>
56785678
</data>
56795679
<data name="ChannelsPage_GuideDiscordHeadline" xml:space="preserve">
5680-
<value>Discord verbinden via een webhook</value>
5680+
<value>Discord verbinden via een bot</value>
56815681
</data>
56825682
<data name="ChannelsPage_GuideDiscordStep1" xml:space="preserve">
5683-
<value>Open uw Discord-serverinstellingen → Integraties → Webhooks.</value>
5683+
<value>Open de Discord Developer Portal en maak of selecteer een toepassing.</value>
56845684
</data>
56855685
<data name="ChannelsPage_GuideDiscordStep2" xml:space="preserve">
5686-
<value>Klik op "New Webhook", geef het een naam en kopieer de webhook-URL.</value>
5686+
<value>Open Bot, voeg zo nodig een bot toe en stel het token opnieuw in om het te kopiëren.</value>
56875687
</data>
56885688
<data name="ChannelsPage_GuideDiscordStep3" xml:space="preserve">
5689-
<value>Plak de URL in het configuratieformulier hieronder.</value>
5689+
<value>Plak het bottoken in het configuratieformulier hieronder.</value>
56905690
</data>
56915691
<data name="ChannelsPage_GuideDiscordStep4" xml:space="preserve">
5692-
<value>Klik op "Save and start".</value>
5692+
<value>Klik op "Save and start" en voeg de bot daarna toe aan uw server met de OAuth2-installatielink.</value>
56935693
</data>
56945694
<data name="ChannelsPage_GuideGoogleChatHeadline" xml:space="preserve">
56955695
<value>Google Chat verbinden via een webhook</value>
@@ -5763,6 +5763,12 @@ Controleer of de gateway actief is.</value>
57635763
<data name="ChannelsPage_FieldBotToken" xml:space="preserve">
57645764
<value>Bot-token</value>
57655765
</data>
5766+
<data name="ChannelsPage_FieldDiscordBotToken" xml:space="preserve">
5767+
<value>Discord-bottoken</value>
5768+
</data>
5769+
<data name="ChannelsPage_PlaceholderDiscordBotToken" xml:space="preserve">
5770+
<value>Plak het Discord-bottoken</value>
5771+
</data>
57665772
<data name="ChannelsPage_FieldWebhookUrl" xml:space="preserve">
57675773
<value>Webhook-URL</value>
57685774
</data>
@@ -5778,8 +5784,8 @@ Controleer of de gateway actief is.</value>
57785784
<data name="ChannelsPage_HelpBotToken" xml:space="preserve">
57795785
<value>Verkrijg het via @BotFather (/newbot).</value>
57805786
</data>
5781-
<data name="ChannelsPage_HelpWebhookDiscord" xml:space="preserve">
5782-
<value>Serverinstellingen → Integraties → Webhooks → New Webhook.</value>
5787+
<data name="ChannelsPage_HelpDiscordBotToken" xml:space="preserve">
5788+
<value>Kopieer uit de Discord Developer Portal → Bot → Token opnieuw instellen.</value>
57835789
</data>
57845790
<data name="ChannelsPage_HelpWebhookGoogleChat" xml:space="preserve">
57855791
<value>Open een ruimte → Webhooks beheren → Webhook toevoegen.</value>

‎src/OpenClaw.Tray.WinUI/Strings/zh-cn/Resources.resw‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5622,7 +5622,7 @@
56225622
<value>如何创建 Telegram 机器人 →</value>
56235623
</data>
56245624
<data name="ChannelsPage_HelpDiscord" xml:space="preserve">
5625-
<value>如何创建 Discord webhook →</value>
5625+
<value>如何创建 Discord 机器人 →</value>
56265626
</data>
56275627
<data name="ChannelsPage_HelpGoogleChat" xml:space="preserve">
56285628
<value>如何添加 Google Chat webhook →</value>
@@ -5676,19 +5676,19 @@
56765676
<value>点击 "Save and start"。频道将自动启动。</value>
56775677
</data>
56785678
<data name="ChannelsPage_GuideDiscordHeadline" xml:space="preserve">
5679-
<value>通过 webhook 连接 Discord</value>
5679+
<value>通过机器人连接 Discord</value>
56805680
</data>
56815681
<data name="ChannelsPage_GuideDiscordStep1" xml:space="preserve">
5682-
<value>打开您的 Discord 服务器设置 → 集成 → Webhooks。</value>
5682+
<value>打开 Discord 开发者门户,然后创建或选择一个应用。</value>
56835683
</data>
56845684
<data name="ChannelsPage_GuideDiscordStep2" xml:space="preserve">
5685-
<value>点击 "New Webhook",为其命名,然后复制 webhook URL。</value>
5685+
<value>打开 Bot,按需添加机器人,然后重置并复制其令牌。</value>
56865686
</data>
56875687
<data name="ChannelsPage_GuideDiscordStep3" xml:space="preserve">
5688-
<value>将 URL 粘贴到下方的配置表单中。</value>
5688+
<value>将机器人令牌粘贴到下方的配置表单中。</value>
56895689
</data>
56905690
<data name="ChannelsPage_GuideDiscordStep4" xml:space="preserve">
5691-
<value>点击 "Save and start"。</value>
5691+
<value>点击 "Save and start",然后使用 OAuth2 安装链接将机器人添加到服务器。</value>
56925692
</data>
56935693
<data name="ChannelsPage_GuideGoogleChatHeadline" xml:space="preserve">
56945694
<value>通过 webhook 连接 Google Chat</value>
@@ -5762,6 +5762,12 @@
57625762
<data name="ChannelsPage_FieldBotToken" xml:space="preserve">
57635763
<value>机器人令牌</value>
57645764
</data>
5765+
<data name="ChannelsPage_FieldDiscordBotToken" xml:space="preserve">
5766+
<value>Discord 机器人令牌</value>
5767+
</data>
5768+
<data name="ChannelsPage_PlaceholderDiscordBotToken" xml:space="preserve">
5769+
<value>粘贴 Discord 机器人令牌</value>
5770+
</data>
57655771
<data name="ChannelsPage_FieldWebhookUrl" xml:space="preserve">
57665772
<value>Webhook 网址</value>
57675773
</data>
@@ -5777,8 +5783,8 @@
57775783
<data name="ChannelsPage_HelpBotToken" xml:space="preserve">
57785784
<value>从 @BotFather (/newbot) 获取。</value>
57795785
</data>
5780-
<data name="ChannelsPage_HelpWebhookDiscord" xml:space="preserve">
5781-
<value>服务器设置 → 集成 → Webhooks → New Webhook。</value>
5786+
<data name="ChannelsPage_HelpDiscordBotToken" xml:space="preserve">
5787+
<value>从 Discord 开发者门户 → Bot → Reset Token 复制。</value>
57825788
</data>
57835789
<data name="ChannelsPage_HelpWebhookGoogleChat" xml:space="preserve">
57845790
<value>打开聊天室 → 管理 webhook → 添加 webhook。</value>

‎src/OpenClaw.Tray.WinUI/Strings/zh-tw/Resources.resw‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5622,7 +5622,7 @@
56225622
<value>如何建立 Telegram 機器人 →</value>
56235623
</data>
56245624
<data name="ChannelsPage_HelpDiscord" xml:space="preserve">
5625-
<value>如何建立 Discord webhook →</value>
5625+
<value>如何建立 Discord 機器人 →</value>
56265626
</data>
56275627
<data name="ChannelsPage_HelpGoogleChat" xml:space="preserve">
56285628
<value>如何新增 Google Chat webhook →</value>
@@ -5676,19 +5676,19 @@
56765676
<value>點擊 "Save and start"。頻道將自動啟動。</value>
56775677
</data>
56785678
<data name="ChannelsPage_GuideDiscordHeadline" xml:space="preserve">
5679-
<value>透過 webhook 連接 Discord</value>
5679+
<value>透過機器人連接 Discord</value>
56805680
</data>
56815681
<data name="ChannelsPage_GuideDiscordStep1" xml:space="preserve">
5682-
<value>開啟您的 Discord 伺服器設定 → 整合 → Webhooks。</value>
5682+
<value>開啟 Discord 開發者入口網站,然後建立或選取應用程式。</value>
56835683
</data>
56845684
<data name="ChannelsPage_GuideDiscordStep2" xml:space="preserve">
5685-
<value>點擊 "New Webhook",為其命名,然後複製 webhook URL。</value>
5685+
<value>開啟 Bot,視需要新增機器人,然後重設並複製其權杖。</value>
56865686
</data>
56875687
<data name="ChannelsPage_GuideDiscordStep3" xml:space="preserve">
5688-
<value>將 URL 貼到下方的設定表單中。</value>
5688+
<value>將機器人權杖貼到下方的設定表單中。</value>
56895689
</data>
56905690
<data name="ChannelsPage_GuideDiscordStep4" xml:space="preserve">
5691-
<value>點擊 "Save and start"。</value>
5691+
<value>點擊 "Save and start",然後使用 OAuth2 安裝連結將機器人新增到伺服器。</value>
56925692
</data>
56935693
<data name="ChannelsPage_GuideGoogleChatHeadline" xml:space="preserve">
56945694
<value>透過 webhook 連接 Google Chat</value>
@@ -5762,6 +5762,12 @@
57625762
<data name="ChannelsPage_FieldBotToken" xml:space="preserve">
57635763
<value>機器人權杖</value>
57645764
</data>
5765+
<data name="ChannelsPage_FieldDiscordBotToken" xml:space="preserve">
5766+
<value>Discord 機器人權杖</value>
5767+
</data>
5768+
<data name="ChannelsPage_PlaceholderDiscordBotToken" xml:space="preserve">
5769+
<value>貼上 Discord 機器人權杖</value>
5770+
</data>
57655771
<data name="ChannelsPage_FieldWebhookUrl" xml:space="preserve">
57665772
<value>Webhook 網址</value>
57675773
</data>
@@ -5777,8 +5783,8 @@
57775783
<data name="ChannelsPage_HelpBotToken" xml:space="preserve">
57785784
<value>從 @BotFather (/newbot) 取得。</value>
57795785
</data>
5780-
<data name="ChannelsPage_HelpWebhookDiscord" xml:space="preserve">
5781-
<value>伺服器設定 → 整合 → Webhooks → New Webhook。</value>
5786+
<data name="ChannelsPage_HelpDiscordBotToken" xml:space="preserve">
5787+
<value>從 Discord 開發者入口網站 → Bot → Reset Token 複製。</value>
57825788
</data>
57835789
<data name="ChannelsPage_HelpWebhookGoogleChat" xml:space="preserve">
57845790
<value>開啟聊天室 → 管理 webhook → 新增 webhook。</value>

0 commit comments

Comments
 (0)