This is a quick and easy template for building your own Discord bot, this project relies on Discord.js, if you want to extend this bot, I suggest you look at the official Discord API documentation and the Discord.js README.
Before building your own bot, I highly advise checking if the bot you want to build already exists, the common places to find Discord bots are:
Step One
You need to create a new Discord Application in the developer console.
Step Two
You need to create a Bot User for your application.
Step Three
You need to add your Bot User's token as a parameter to client.login()
, these will be used by the code to act on behalf of your registered application's bot.
If you want to avoid unneeded complexity, untick Require OAuth2 Code Grant.
Step Four
Generate your bot's OAuth2 URL and it can then be invited to any channel with just a click of a link.
Step Five
Remix this project, look through the code in server.js
and add the custom commands you wish your bot to have and VIOLA, you're now the proud owner of your own Discord bot ππππ
Go build something cool.
Discord is all-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone. Stop paying for TeamSpeak servers and hassling with Skype. Simplify your life.
Glitch is the friendly community where you'll build the app of your dreams. Glitch lets you instantly create, remix, edit, and host an app, bot or site, and you can invite collaborators or helpers to simultaneously edit code with you.
Find out more about Glitch.