mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 01:33:29 +00:00
fix(discord): harden slash command routing
This commit is contained in:
@@ -263,6 +263,14 @@ export async function preflightDiscordMessage(
|
||||
const messageText = resolveDiscordMessageText(message, {
|
||||
includeForwarded: true,
|
||||
});
|
||||
|
||||
// Intercept text-only slash commands (e.g. user typing "/reset" instead of using Discord's slash command picker)
|
||||
// These should not be forwarded to the agent; proper slash command interactions are handled elsewhere
|
||||
if (!isDirectMessage && baseText && hasControlCommand(baseText, params.cfg)) {
|
||||
logVerbose(`discord: drop text-based slash command ${message.id} (intercepted at gateway)`);
|
||||
return null;
|
||||
}
|
||||
|
||||
recordChannelActivity({
|
||||
channel: "discord",
|
||||
accountId: params.accountId,
|
||||
|
||||
Reference in New Issue
Block a user