mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 20:44:32 +00:00
fix(discord): prevent wildcard component registration collisions
Assign distinct sentinel registration ids to Discord wildcard handlers while preserving wildcard parser keys, so select/menu/modal handlers no longer get dropped on runtimes that dedupe by raw customId.
This commit is contained in:
committed by
Peter Steinberger
parent
c869ca4bbf
commit
6210d2e238
@@ -646,8 +646,12 @@ export function parseDiscordModalCustomId(id: string): string | null {
|
||||
return modalId;
|
||||
}
|
||||
|
||||
function isDiscordComponentWildcardRegistrationId(id: string): boolean {
|
||||
return /^__openclaw_discord_component_[a-z_]+_wildcard__$/.test(id);
|
||||
}
|
||||
|
||||
export function parseDiscordComponentCustomIdForCarbon(id: string): ComponentParserResult {
|
||||
if (id === "*") {
|
||||
if (id === "*" || isDiscordComponentWildcardRegistrationId(id)) {
|
||||
return { key: "*", data: {} };
|
||||
}
|
||||
const parsed = parseCustomId(id);
|
||||
@@ -658,7 +662,7 @@ export function parseDiscordComponentCustomIdForCarbon(id: string): ComponentPar
|
||||
}
|
||||
|
||||
export function parseDiscordModalCustomIdForCarbon(id: string): ComponentParserResult {
|
||||
if (id === "*") {
|
||||
if (id === "*" || id === "__openclaw_discord_component_modal_wildcard__") {
|
||||
return { key: "*", data: {} };
|
||||
}
|
||||
const parsed = parseCustomId(id);
|
||||
|
||||
Reference in New Issue
Block a user