Skip to content

A boilerplate example bot with command handler and reloadable commands. Updated and Maintained by the Idiot's Guide Community

License

Notifications You must be signed in to change notification settings

exelenuwu/guidebot-class

 
 

Repository files navigation

Guide Bot

An boilerplate of a Discord.js Bot Handler. Updated and Maintained by the Idiot's Guide Community.

Guidebot is an attempt to show the basics of command and event handling, in clear, concise, and commented code. Guidebot can be used as the template for any type of bot, and contains most of the basic features you would need:

  • A command handler
  • A basic permission system
  • An event handler
  • Basic useful commands
  • Per-server configuration system
  • A logging system

Guidebot-Class differs from Guidebot in one thing and one thing only: it's built using Classes and not functions. That's it, the rest should be functionally identical.

Need support? Join the Idiot's Guide Community!

Requirements

You also need your bot's token. This is obtained by creating an application in the Developer section of discordapp.com. Check the first section of this page for more info.

Intents

Guidebot-Class 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 the index.js file, and is pre-set with the Guilds, Guild Messages and Direct Messages intents.

For more info about intents checkout the official Discord.js guide page and the official Discord docs page.

Downloading

In a command prompt in your projects folder (wherever that may be) run the following:

git clone https://github.com/An-Idiots-Guide/guidebot-class.git

Once finished:

  • In the folder from where you ran the git command, run cd guidebot-class and then run npm install, which will install the required packages, and it will then run the installer, make sure you have your token at hand to paste into the console.
  • If you get any error about python or msibuild.exe or binding, read the requirements section again!
  • The installer will create the config.js file for you.

Starting the bot

To start the bot, in the command prompt, run the following command: node index.js

Inviting to a guild

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

About

A boilerplate example bot with command handler and reloadable commands. Updated and Maintained by the Idiot's Guide Community

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%