A Discord bot which allows any normal user to created. - easy and fun. (No knowledge needed.)
Bot Installation and First Run
How to get the bot online, and to your specifications:
- Make a bot user. (https://discordapp.com/developers/applications/me)
- Find the token.
- Put the token in the required section on the bot.js file.
- Change the prefix.
- Change the clientname to the name of your bot, and add the client ID if so wished for.
- Make sure all requirements are installed (list below)
- Open command prompt (CMD) and go to the location of the bot.js file; You can do this with the command "cd directory"
- Once you are in the directory which has the bot.js file you can type in node bot.js
- The bot should then run, you can make an invite link using this permissions calculator: https://discordapi.com/permissions.html
- Play around with the bot, maybe even add some custom commands.
node.js npm discord.js
This will show you how to add custom commands, if you have already used the presets.
- Find an old preset (one you've already used, example below:)
if (message.content === (prefix + command3)) {
message.channel.send(command3text)
}
- Go underneath that preset and copy it again, so know you have to copies. e.g.
if (message.content === (prefix + command3)) {
message.channel.send(command3text)
}
if (message.content === (prefix + command3)) {
message.channel.send(command3text)
}
- Create the configuration for the custom commands. e.g.
- Make a copy of one set of the config. e.g.
command3 = ''
command3text = ''
- And re-paste it below where you copied it from - so you have this:
command3 = ''
command3text = ''
command3 = ''
command3text = ''
- Edit the new command code sets:
If you have already had custom command 1, 2, 3 you will use 4 for this next bit:
if (message.content === (prefix + command3)) { // Change custom to command4 (Depends what you've already used it could be 10)
message.channel.send(command3text) // Change command3text to command4text (Depends what you've already used it could be 10)
}
- Go back to your new bit of configuration and change it to this: (dependant on the number you used for the last step)
command3 = '' // Old one - the one you copied from
command3text = ''
command4 = '' // New one - the one you recently pasted
command4text = '' // Change both 3's to your new number (in my case 4)
-
Change the values to what you want it to use, and what you want it to say.
-
Test it!