I made a Discord chatbot for my friends one weekend and decided to strip all personal functions to create this skeleton-of-a-Discord-bot project. Feel free to contact me (or open an issue or pull request) if you have any questions or suggestions.
npm install
- Create a Discord bot on Discord's developer site
- Supply API token in
.env
file (DISCORD_TOKEN=your_api_token_here
) - Add bot to your Discord server
node z-bot.js
- Use MongoDB & Mongoose
- Dialogflow for ML chatbot
- Chalk.js for pretty console messages
- v1.0 (04/23/18) - Release barebones app
1. Open https://discordapp.com/developers/applications/me and click on "New App".
2. Enter a name for your bot and click "Create App"
3. Click on "Create a Bot user"
4. Reveal the bot's token. This token is used to login your bot.
In order to add a bot to your server you need it's client id.
You can get your client id from the same page where you created it.
With this id you can create an invite link for your bot:
https://discordapp.com/api/oauth2/authorize?client_id=123456789&scope=bot&permissions=0
If you are the owner or admin of the server you can use this link to add your bot to your server. Otherwise you have to give the link to the server owner/admin and ask him to add your bot.
^ from @BtoBastian