mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-11-22 14:41:05 +01:00
refactor: just ignore when something is bad in message cmds
This commit is contained in:
parent
c7f7ddd1a3
commit
6ce4a36feb
1 changed files with 3 additions and 10 deletions
|
@ -4,7 +4,8 @@ import { searchTag } from "../loaders/tags.ts";
|
||||||
export default {
|
export default {
|
||||||
name: "tag",
|
name: "tag",
|
||||||
run: async (message, args) => {
|
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 target = args[1]?.match(/([0-9]+)/)?.[0];
|
||||||
const resolvedTarget = target
|
const resolvedTarget = target
|
||||||
|
@ -12,15 +13,7 @@ export default {
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
const tag = searchTag(await message.fetchChannel(), keyword, false);
|
const tag = searchTag(await message.fetchChannel(), keyword, false);
|
||||||
if (!keyword || !tag) {
|
if (!keyword || !tag) return; // just ignore
|
||||||
// @ts-expect-error allowed_mentions
|
|
||||||
return message.reply({
|
|
||||||
content: `\`❌\` Could not find a tag \`${keyword}\``,
|
|
||||||
allowed_mentions: {
|
|
||||||
parse: [],
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// @ts-expect-error allowed_mentions
|
// @ts-expect-error allowed_mentions
|
||||||
message.reply({
|
message.reply({
|
||||||
|
|
Loading…
Reference in a new issue