fix: avoid Discord /tts conflict
This commit is contained in:
@@ -254,7 +254,7 @@ async function handleDiscordCommandArgInteraction(
|
||||
return;
|
||||
}
|
||||
const commandDefinition =
|
||||
findCommandByNativeName(parsed.command) ??
|
||||
findCommandByNativeName(parsed.command, "discord") ??
|
||||
listChatCommands().find((entry) => entry.key === parsed.command);
|
||||
if (!commandDefinition) {
|
||||
await safeDiscordInteractionCall("command arg update", () =>
|
||||
@@ -395,7 +395,7 @@ export function createDiscordNativeCommand(params: {
|
||||
}) {
|
||||
const { command, cfg, discordConfig, accountId, sessionPrefix, ephemeralDefault } = params;
|
||||
const commandDefinition =
|
||||
findCommandByNativeName(command.name) ??
|
||||
findCommandByNativeName(command.name, "discord") ??
|
||||
({
|
||||
key: command.name,
|
||||
nativeName: command.name,
|
||||
|
||||
@@ -346,11 +346,13 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) {
|
||||
const maxDiscordCommands = 100;
|
||||
let skillCommands =
|
||||
nativeEnabled && nativeSkillsEnabled ? listSkillCommandsForAgents({ cfg }) : [];
|
||||
let commandSpecs = nativeEnabled ? listNativeCommandSpecsForConfig(cfg, { skillCommands }) : [];
|
||||
let commandSpecs = nativeEnabled
|
||||
? listNativeCommandSpecsForConfig(cfg, { skillCommands, provider: "discord" })
|
||||
: [];
|
||||
const initialCommandCount = commandSpecs.length;
|
||||
if (nativeEnabled && nativeSkillsEnabled && commandSpecs.length > maxDiscordCommands) {
|
||||
skillCommands = [];
|
||||
commandSpecs = listNativeCommandSpecsForConfig(cfg, { skillCommands: [] });
|
||||
commandSpecs = listNativeCommandSpecsForConfig(cfg, { skillCommands: [], provider: "discord" });
|
||||
runtime.log?.(
|
||||
warn(
|
||||
`discord: ${initialCommandCount} commands exceeds limit; removing per-skill commands and keeping /skill.`,
|
||||
|
||||
Reference in New Issue
Block a user