This is the "framework" I made for natsubot, on hummus.
Feel free to modify.
Please read the eris docs, you people using this are probably random 12 year olds with no prior coding knowledge.
Before doing anything, rename .env.example
to .env
To run this, download the code, and then place it in a folder.
Open terminal, then run
npm i
This will install all required libraries. After done installing, edit the .env file and add your hummus bot token.
DO NOT FORGET TO ADD A PREFIX
After modifying .env, you can run the bot by running
npm start
In the src folder, there are two folders. "commands" and "events"
You can add events by making a file with the event name and adding this code into it
Heres a useful link for a list of events, all events are from callCreate to the bottom.
module.exports = {
async execute(client) {
// Code that will execute on the event
},
}
Put your code in the execute function, it will run when that event is fired.
There is already a command handler in the events folder under messageCreate.js
.
In the commands
folder, add a js file, name it whatever you want the command to be called. For example, lets say I want to make a command called help
.
If I want it to say "You need help? I gotchu bro" I would add this:
module.exports = {
async execute(client, message, args) {
await message.channel.createMessage('You need help? I gotchu bro')
},
}
This will execute when the user runs the help command, BE SURE TO ADD YOUR OWN PREFIX IN THE .env FILE
Dm me on discord, my username is "nilenta"
Alternatively, you can dm me on hummus, my hummus tag is "natsu#1863"