mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 02:20:21 +00:00
refactor: tighten plugin sdk channel surfaces
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
||||
import { formatAllowlistMatchMeta } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import { issuePairingChallenge } from "openclaw/plugin-sdk/conversation-runtime";
|
||||
import { upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-runtime";
|
||||
import { resolveSlackAllowListMatch } from "./allow-list.js";
|
||||
import type { SlackMonitorContext } from "./context.js";
|
||||
@@ -37,11 +37,8 @@ export async function authorizeSlackDirectMessage(params: {
|
||||
}
|
||||
|
||||
if (params.ctx.dmPolicy === "pairing") {
|
||||
await issuePairingChallenge({
|
||||
await createChannelPairingChallengeIssuer({
|
||||
channel: "slack",
|
||||
senderId: params.senderId,
|
||||
senderIdLine: `Your Slack user id: ${params.senderId}`,
|
||||
meta: { name: senderName },
|
||||
upsertPairingRequest: async ({ id, meta }) =>
|
||||
await upsertChannelPairingRequest({
|
||||
channel: "slack",
|
||||
@@ -49,6 +46,10 @@ export async function authorizeSlackDirectMessage(params: {
|
||||
accountId: params.accountId,
|
||||
meta,
|
||||
}),
|
||||
})({
|
||||
senderId: params.senderId,
|
||||
senderIdLine: `Your Slack user id: ${params.senderId}`,
|
||||
meta: { name: senderName },
|
||||
sendPairingReply: params.sendPairingReply,
|
||||
onCreated: () => {
|
||||
params.log(
|
||||
|
||||
Reference in New Issue
Block a user