diff --git a/packages/publisher/index.ts b/packages/publisher/index.ts index 6054889..cf5297c 100644 --- a/packages/publisher/index.ts +++ b/packages/publisher/index.ts @@ -18,15 +18,9 @@ const intoApplicationType = (type: number) => type === 3 ? 1 : Math.log2(type); const makeDescription = (type: number, desc: string) => { - if ((type == CommandType.Slash || type == CommandType.Both) && (!desc || desc.length === 0)) { + if ((type == CommandType.Slash || type == CommandType.Both) && !desc) { throw new Error('Found application command that has no description field or is empty.'); } - if ((type == CommandType.CtxMsg || type == CommandType.CtxUser) && desc.length > 0) { - console.warn( - 'Found context menu that has non empty description field. Implictly publishing with empty description.' - ); - return ''; - } return desc; }; @@ -88,8 +82,8 @@ export class Publisher implements Init { contexts } = publish; return { name: module.name, type: applicationType, - //@ts-ignore we know description is at least empty str or filled - description: makeDescription(applicationType, module.description), + //DO NOT IGNORE! + description:(module.type == CommandType.CtxMsg || module.type == CommandType.CtxUser) ? '' : makeDescription(applicationType, module.description), //@ts-ignore shutup options: optionsTransformer(module?.options), default_member_permissions, diff --git a/packages/publisher/package.json b/packages/publisher/package.json index fdac984..431a706 100644 --- a/packages/publisher/package.json +++ b/packages/publisher/package.json @@ -1,6 +1,6 @@ { "name": "@sern/publisher", - "version": "1.1.4", + "version": "1.1.5", "description": "Publish commands in sern with ease!", "main": "dist/index.js", "scripts": { @@ -9,8 +9,8 @@ "test": "exit 0" }, "devDependencies": { - "@sern/handler": "^4.0.0", - "discord.js": "^14.15.3", + "@sern/handler": "^4.2.4", + "discord.js": "^14.21.0", "vitest": "^1.2.2" }, "keywords": [],