Giter Club home page Giter Club logo

basic-bot's Introduction

A Super Simple Boilerplate for creating Discord Bots ๐Ÿค–

Just want to get up and running developing your own bots for you Discord Server? This boilerplate code has you covered! Along with a comprehensive yet concise guide to setting up.

The Boring Setup ๐Ÿ˜ด

As with anything, there is a bit of setup that is inevitable...

TL;DR

1.) Here (might need to sign in)

2.) Save Client ID

3.) Bot -> Add Bot, save Token somewhere, set permissions

4.) Here: https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID&scope=bot&permissions=PERMISSIONS

Things You Need

  • NodeJS v8.0.0 or higher
  • NPM v5 or higher

Then jump here


The Slightly Longer version

Navigate your way over to the Discord Developer Applications page and create yourself a new app. Sign into your regular Discord account if asked to.

Give it a name, some sort of description and an icon if you're feeling fancy.

Before you leave this page, be sure to copy down the Client ID as this will be important for later.

Once that is done, click the Bot button on the left hand side under Settings. This is where you will bring your app to life!

Click the Add Bot button. This will give your app "visible life in Discord". This is vital. (Say yes to the popup as well)


A wild bot has appeared!

The page will now provide you with a different set of information. From here, you'll be able to decide whether you want to make your bot public, and/or require a full OAuth2 flow.

Click the text that says Click to Reveal Token and copy the long string of letters and numbers that it shows. This is how discord will know that the code you've written is the bot you've specified here.

Quickly select the permissions that you need for your bot at the bottom of the page. Make sure to copy the Permissions Integer as that is important when linking your bot to your server!


Last bit of setup, hang in there ๐Ÿ‘Œ

(At this point, if you don't have a server. Go and create one! It's quick and easy, and it's free!)

Take this URL: https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID&scope=bot&permissions=PERMISSIONS

Replacing CLIENT_ID with your ClientID and PERMISSIONS with the Permissions Integer that you just copied. Then navigate to the page.

From here, you can select the server that you wish to connect your bot to from the dropdown and then click Authorize.

Your bot is now allowed on your server!

Depending on the roles setup on your particular server, you might have to assign a few to the bot to allow it to do everything you want.


Finally, the code

This bit is nice and simple ๐Ÿ˜Š

1.) cp config.example.json config.json

Creates a copy of the file config.example.json called config.json which is used by the bot.

2.) In the config.json, fill in the Discord Token with the Token that you copied from your bot and pick a prefix (the default is !).

3.) npm install && node bot.js

Installs the required dependencies for the bot and then runs NodeJS on the bot.js file.

4.) Enjoy being able to interact with your bot from the comfort of your own Discord Server!

basic-bot's People

Contributors

dependabot-preview[bot] avatar scallaway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.