How tags should work ?

When using commands, you want certain commands to only run on a server or in private messages etc.
Most other CommandHandlers uses boolean properties like guildOnly.
To avoid having a ton of these, I imagined a system where you have command tags and for every call, tags of the command are verified one by one.
And this system works very smoothly !
So if you're using the default message event (see how to use defaults events), tags will be checked.

Example

if (command.tags.includes(Tag.guildOnly) && !message.guild) {
message.channel.send(`You must be on a guild to execute the ${command.name} command !`);
}

Enumeration Members

channelOnly: "channelOnly"

Tag for commands to not run in a thread.

dmOnly: "dmOnly"

Tag for commands to only run in private messages.

guildOnly: "guildOnly"

Tag for commands to only run on a guild.

guildOwnerOnly: "guildOwnerOnly"

Tag for commands to only run on a guild and if the author is the owner of the guild.

nsfw: "nsfw"

Tag for commands to only run on a guild and in an NSFW channel.

ownerOnly: "ownerOnly"

Tag for commands to only run if author is an owner defined in CommandHandler.owners.

threadOnly: "threadOnly"

Tag for commands to only run in a thread.

Generated using TypeDoc