mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 01:28:27 +00:00
fix: scope telegram skill commands per bot (#4360) (thanks @robhparker)
This commit is contained in:
@@ -257,11 +257,15 @@ export const registerTelegramNativeCommands = ({
|
||||
shouldSkipUpdate,
|
||||
opts,
|
||||
}: RegisterTelegramNativeCommandsParams) => {
|
||||
const boundRoute = resolveAgentRoute({ cfg, channel: "telegram", accountId });
|
||||
const boundAgentIds = boundRoute?.agentId ? [boundRoute.agentId] : undefined;
|
||||
const boundRoute =
|
||||
nativeEnabled && nativeSkillsEnabled
|
||||
? resolveAgentRoute({ cfg, channel: "telegram", accountId })
|
||||
: null;
|
||||
const boundAgentIds =
|
||||
boundRoute && boundRoute.matchedBy.startsWith("binding.") ? [boundRoute.agentId] : null;
|
||||
const skillCommands =
|
||||
nativeEnabled && nativeSkillsEnabled
|
||||
? listSkillCommandsForAgents({ cfg, agentIds: boundAgentIds })
|
||||
? listSkillCommandsForAgents(boundAgentIds ? { cfg, agentIds: boundAgentIds } : { cfg })
|
||||
: [];
|
||||
const nativeCommands = nativeEnabled
|
||||
? listNativeCommandSpecsForConfig(cfg, { skillCommands, provider: "telegram" })
|
||||
|
||||
Reference in New Issue
Block a user