refactor: trim discord access-group wrappers · openclaw/openclaw@4d801fa
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
File tree
extensions/discord/src/monitor
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { |
2 | | -ACCESS_GROUP_ALLOW_FROM_PREFIX, |
3 | | -parseAccessGroupAllowFromEntry, |
4 | 2 | resolveAccessGroupAllowFromMatches, |
5 | 3 | type AccessGroupMembershipResolver, |
6 | 4 | } from "openclaw/plugin-sdk/command-auth"; |
@@ -9,12 +7,6 @@ import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
9 | 7 | import type { RequestClient } from "../internal/discord.js"; |
10 | 8 | import { canViewDiscordGuildChannel } from "../send.permissions.js"; |
11 | 9 | |
12 | | -export const DISCORD_ACCESS_GROUP_PREFIX = ACCESS_GROUP_ALLOW_FROM_PREFIX; |
13 | | - |
14 | | -export function parseDiscordAccessGroupEntry(entry: string): string | null { |
15 | | -return parseAccessGroupAllowFromEntry(entry); |
16 | | -} |
17 | | - |
18 | 10 | export function createDiscordAccessGroupMembershipResolver(params: { |
19 | 11 | token?: string; |
20 | 12 | rest?: RequestClient; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -64,12 +64,14 @@ export function createDiscordMessage(params: {
|
64 | 64 | mentionedUsers?: Array<{ id: string }>; |
65 | 65 | mentionedEveryone?: boolean; |
66 | 66 | attachments?: Array<Record<string, unknown>>; |
| 67 | +webhookId?: string; |
67 | 68 | }): import("../internal/discord.js").Message { |
68 | 69 | return { |
69 | 70 | id: params.id, |
70 | 71 | content: params.content, |
71 | 72 | timestamp: new Date().toISOString(), |
72 | 73 | channelId: params.channelId, |
| 74 | +webhookId: params.webhookId, |
73 | 75 | attachments: params.attachments ?? [], |
74 | 76 | mentionedUsers: params.mentionedUsers ?? [], |
75 | 77 | mentionedRoles: [], |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -696,7 +696,7 @@ describe("preflightDiscordMessage", () => {
|
696 | 696 | id: "m-webhook-proxy-1", |
697 | 697 | channelId: threadId, |
698 | 698 | content: "proxied user message", |
699 | | -webhook_id: "pluralkit-webhook-1", |
| 699 | +webhookId: "pluralkit-webhook-1", |
700 | 700 | author: { |
701 | 701 | id: "relay-bot-1", |
702 | 702 | bot: true, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。