An example of a Discord.js Bot Handler. Updated and Maintained by the Idiot's Guide Community.
Ages ago, Guide Bot was actually a little bot I had on the official discord.js server. It helped me link to the d.js bot making guide I was building, with links. This bot grew into something that I could show new coders and bot makers, but over time it grew into a full framework - one that is now under the hands of a group of contributors, and no longer easily "understandable" by the majority of our newbies. So I've pulled the original Guide Bot out of the mothballs, gave it a fresh coat of paint and grease, and here it is back in its full glory!
git
command line (Windows|Linux|MacOS) installednode
Version 12.0.0 or higher- The node-gyp build tools. This is a pre-requisite for Enmap, but also for a lot of other modules. See The Enmap Guide for details and requirements for your OS. Just follow what's in the tabbed block only, then come back here!
You also need your bot's token. This is obtained by creating an application in the Developer section of discord.com. Check the first section of this page for more info.
Guidebot uses intents which are required as of October 7, 2020.
You can enable privileged intents in your bot page
(the one you got your token from) under Privileged Gateway Intents
.
By default GuideBot needs the Guilds, Guild Messages and Direct Messages intents to work. For join messages to work you need Guild Members, which is privileged. User counts that GuideBot has in places such as in the ready log, and the stats command may be incorrect without the Guild Members intent.
Intents are loaded from your config, and will get created by the setup scripts.
For more info about intents checkout the official Discord.js guide page and the official Discord docs page.
In a command prompt in your projects folder (wherever that may be) run the following:
git clone https://github.com/An-Idiots-Guide/guidebot.git
Once finished:
- In the folder from where you ran the git command, run
cd guidebot
and then runnpm install
- If you get any error about python or msibuild.exe or binding, read the requirements section again!
- Run
node setup.js
to generate a proper configuration file and settings.
To start the bot, in the command prompt, run the following command:
node index.js
To add the bot to your guild, you have to get an oauth link for it.
You can use this site to help you generate a full OAuth Link, which includes a calculator for the permissions: https://finitereality.github.io/permissions-calculator/?v=0