From 6ce4a36febe7c18d627ea7a08eff6a35c0a7ab19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jozef=20Steinh=C3=BCbl?= Date: Fri, 10 May 2024 17:17:23 +0200 Subject: [PATCH] refactor: just ignore when something is bad in message cmds --- src/message-commands/tag.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/message-commands/tag.ts b/src/message-commands/tag.ts index b0e7ac3..6db9283 100644 --- a/src/message-commands/tag.ts +++ b/src/message-commands/tag.ts @@ -4,7 +4,8 @@ import { searchTag } from "../loaders/tags.ts"; export default { name: "tag", run: async (message, args) => { - const keyword = args[0] ?? "what-is-bun"; + const keyword = args[0]; + if (!keyword) return; // just ignore const target = args[1]?.match(/([0-9]+)/)?.[0]; const resolvedTarget = target @@ -12,15 +13,7 @@ export default { : null; const tag = searchTag(await message.fetchChannel(), keyword, false); - if (!keyword || !tag) { - // @ts-expect-error allowed_mentions - return message.reply({ - content: `\`❌\` Could not find a tag \`${keyword}\``, - allowed_mentions: { - parse: [], - }, - }); - } + if (!keyword || !tag) return; // just ignore // @ts-expect-error allowed_mentions message.reply({