fix: truncate skill command descriptions to 100 chars for Discord (#1018)
* fix: truncate skill command descriptions to 100 chars for Discord Discord slash commands have a 100 character limit for descriptions. Skill descriptions were not being truncated, causing command registration to fail with an empty error from the Discord API. * style: format * style: format
This commit is contained in:
@@ -5,9 +5,7 @@ describe("resolveSkillCommandInvocation", () => {
|
||||
it("matches skill commands and parses args", () => {
|
||||
const invocation = resolveSkillCommandInvocation({
|
||||
commandBodyNormalized: "/demo_skill do the thing",
|
||||
skillCommands: [
|
||||
{ name: "demo_skill", skillName: "demo-skill", description: "Demo" },
|
||||
],
|
||||
skillCommands: [{ name: "demo_skill", skillName: "demo-skill", description: "Demo" }],
|
||||
});
|
||||
expect(invocation?.command.skillName).toBe("demo-skill");
|
||||
expect(invocation?.args).toBe("do the thing");
|
||||
@@ -16,9 +14,7 @@ describe("resolveSkillCommandInvocation", () => {
|
||||
it("returns null for unknown commands", () => {
|
||||
const invocation = resolveSkillCommandInvocation({
|
||||
commandBodyNormalized: "/unknown arg",
|
||||
skillCommands: [
|
||||
{ name: "demo_skill", skillName: "demo-skill", description: "Demo" },
|
||||
],
|
||||
skillCommands: [{ name: "demo_skill", skillName: "demo-skill", description: "Demo" }],
|
||||
});
|
||||
expect(invocation).toBeNull();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user