can i edit the frame work to apply custom commands or not.

So i want to edit the frame work to make it able to handle custom commands i am using mongo db for the data storing of custom commands. Is it possible if yes how can i do it
16 Replies
Ben
Ben2y ago
Sapphire is literally meant to allow you to build custom commands. It ships with no premade commands.
vphilip
vphilipOP2y ago
oh nice where is the specfic file that i can write code for it so it can find the data and run custom commands i am pretty new to it so sorry i am being dumb
Ben
Ben2y ago
If you're just getting started with sapphire for the first time I recommend you read the guide: https://www.sapphirejs.dev/docs/Guide/getting-started/getting-started-with-sapphire As far as your database goes, you can implement it however you want, sapphire has no build in database and lets you do whatever you want (including not having a db at all). Personally I have my DB assessable on the container which you can also find out about by reading the guide.
Sapphire Framework
Getting started with Sapphire | Sapphire
To install Sapphire, you need to install both discord.js and @sapphire/framework. You can do this by running the
24
242y ago
If you are new to coding, it is advised to learn JS first then a bot, lol beat you
ararou!
ararou!2y ago
I think hes trying to do where you do >command create name and then when you run >name it executes it as that
vphilip
vphilipOP2y ago
yeah thats what i want
Ben
Ben2y ago
Yeah but I answered both their questions
24
242y ago
apparently not
vphilip
vphilipOP2y ago
^^
Ben
Ben2y ago
Ohh In that case you'll probably want to create a command (or a few) to manage creating/editing/deleting the custom "commands" and a listener to listen to the unknown command event and the look to see if its a valid custom "command" to reply to. Again you can implement the db however you want and I still recommend putting it in the container.
vphilip
vphilipOP2y ago
alr ty for the help one last question how can i do the listers part like what event should i put
Ben
Ben2y ago
There should be an unknown message command event or something like that That gets triggered when the bot sees a message with the prefix but cant map it to a message command
vphilip
vphilipOP2y ago
cant find that in my case i will do some digging and see if i can make that
vphilip
vphilipOP2y ago
ty
Want results from more Discord servers?
Add your server