mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 10:11:24 +00:00
feat(discord): add set-presence action for bot activity and status
Bridge the agent tools layer to the Discord gateway WebSocket via a new gateway registry, allowing agents to set the bot's activity and online status. Supports playing, streaming, listening, watching, custom, and competing activity types. Custom type uses activityState as the sidebar text; other types show activityName in the sidebar and activityState in the flyout. Opt-in via channels.discord.actions.presence (default false). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
clawdinator[bot]
parent
b64c1a56a1
commit
5af322f710
@@ -193,6 +193,36 @@ function buildGatewaySchema() {
|
||||
};
|
||||
}
|
||||
|
||||
function buildPresenceSchema() {
|
||||
return {
|
||||
activityType: Type.Optional(
|
||||
Type.String({
|
||||
description: "Activity type: playing, streaming, listening, watching, competing, custom.",
|
||||
}),
|
||||
),
|
||||
activityName: Type.Optional(
|
||||
Type.String({
|
||||
description: "Activity name shown in sidebar (e.g. 'with fire'). Ignored for custom type.",
|
||||
}),
|
||||
),
|
||||
activityUrl: Type.Optional(
|
||||
Type.String({
|
||||
description:
|
||||
"Streaming URL (Twitch or YouTube). Only used with streaming type; may not render for bots.",
|
||||
}),
|
||||
),
|
||||
activityState: Type.Optional(
|
||||
Type.String({
|
||||
description:
|
||||
"State text. For custom type this is the status text; for others it shows in the flyout.",
|
||||
}),
|
||||
),
|
||||
status: Type.Optional(
|
||||
Type.String({ description: "Bot status: online, dnd, idle, invisible." }),
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
function buildChannelManagementSchema() {
|
||||
return {
|
||||
name: Type.Optional(Type.String()),
|
||||
@@ -225,6 +255,7 @@ function buildMessageToolSchemaProps(options: { includeButtons: boolean; include
|
||||
...buildModerationSchema(),
|
||||
...buildGatewaySchema(),
|
||||
...buildChannelManagementSchema(),
|
||||
...buildPresenceSchema(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user