refactor: trim discord access-group wrappers

This commit is contained in:
Peter Steinberger
2026-05-02 05:41:13 +01:00
parent e873c1e1f8
commit 4d801fadab
3 changed files with 3 additions and 9 deletions

View File

@@ -1,6 +1,4 @@
import {
ACCESS_GROUP_ALLOW_FROM_PREFIX,
parseAccessGroupAllowFromEntry,
resolveAccessGroupAllowFromMatches,
type AccessGroupMembershipResolver,
} from "openclaw/plugin-sdk/command-auth";
@@ -9,12 +7,6 @@ import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
import type { RequestClient } from "../internal/discord.js";
import { canViewDiscordGuildChannel } from "../send.permissions.js";
export const DISCORD_ACCESS_GROUP_PREFIX = ACCESS_GROUP_ALLOW_FROM_PREFIX;
export function parseDiscordAccessGroupEntry(entry: string): string | null {
return parseAccessGroupAllowFromEntry(entry);
}
export function createDiscordAccessGroupMembershipResolver(params: {
token?: string;
rest?: RequestClient;

View File

@@ -64,12 +64,14 @@ export function createDiscordMessage(params: {
mentionedUsers?: Array<{ id: string }>;
mentionedEveryone?: boolean;
attachments?: Array<Record<string, unknown>>;
webhookId?: string;
}): import("../internal/discord.js").Message {
return {
id: params.id,
content: params.content,
timestamp: new Date().toISOString(),
channelId: params.channelId,
webhookId: params.webhookId,
attachments: params.attachments ?? [],
mentionedUsers: params.mentionedUsers ?? [],
mentionedRoles: [],

View File

@@ -696,7 +696,7 @@ describe("preflightDiscordMessage", () => {
id: "m-webhook-proxy-1",
channelId: threadId,
content: "proxied user message",
webhook_id: "pluralkit-webhook-1",
webhookId: "pluralkit-webhook-1",
author: {
id: "relay-bot-1",
bot: true,