Replies: 1 comment
-
There is no "cleaner" way to do it. Message-based prefix command always were and still are a process of receiving the message content, checking if it starts with your chosen prefix, and slicing and splitting up the string to extract the necessary information. Receiving message content does require you to enable a privileged intent, which requires Discords approval and verification if your bot is in more than 100 guilds. Slash commands are a massive improvement; they're natively integrated into the Discord UI, the argument handling and parsing is all done for you by Discord, and they're easily discoverable for users. There are also specific features that cannot be used except in response to a slash command: ephemeral replies and modals. I'd hardly call a few years a "new" feature and strongly encourage you to use them. |
Beta Was this translation helpful? Give feedback.
-
So, slash commands are relatively new, right? A few years at most. You type in a slash, and type something out and a menu will manifest over the chat, and give you options and instructions.
This is not about the above. I'm interested in doing bot commands in the old school way. Such as !ping, or t@prune, where '!' and 't@' are the prefixes. Is there a proper way to do this? OR do I just create switch on
client.on('messagecreate'
I'm assuming it's not the above; I'm assuming there is a cleaner way to go about it. I also have a vague recollection of reading somewhere that, to get approved for that kind of bot command officially, your bot/app needs to be verified? I'm not sure how true that is.
Beta Was this translation helpful? Give feedback.
All reactions