Giter Club home page Giter Club logo

discord-bot-v14's Introduction

Create Discord Bot

A module-based Discord bot template.

Getting started

Register a Discord bot application

  1. Go to Discord's Developer Portal.

  2. Create a new application.

    Take note of the APPLICATION ID on the General Information tab page. You will need it to invite the bot to your server in step 5.

  3. Go to the Bot tab and add a bot user to your application.

    Take note of the TOKEN on the Bot tab page. You will need it in step 3 of the next section.

    Keep your token and any file containing it private. If it ever leaks or you suspect it may have leaked, simply regenerate a new token to invalidate your compromised token.

  4. While in the Bot tab, scroll down to the Privileged Gateway Intents section and enable the toggles for both Presence Intent and Server Members Intent. More information on Gateway Intents can be found here:

  5. Lastly, invite the bot to your server using the following link template: https://discord.com/oauth2/authorize?scope=bot&client_id=APPLICATION_ID_HERE

Create a Discord bot project

  1. Run the following commands to bootstrap a Discord bot project in your working directory:

    Replace bot-discord in the commands below with your own preferred project name!

    git clone https://github.com/SrCrow02/Discord-Bot-V14.git
    
    cd bot-discord
    
    npm i
    
  2. in config.json put your Token, Bot id and Server ID:

      {
        "prefix": "PREFIX",
        "token": "BOT_PREFIX",
        
        "botID": "ID_BOT",
        "serverID": "ID_SERVER", 
    
        "staff": [
            "YOUR_STAFF"
        ]
     }
  3. Lastly, run the following command to start the bot:

    node index.js
    

    Verify the bot is running properly by sending messages in your server. The bot should log these messages in your terminal. If there are any issues, check Troubleshooting.

You're ready to create your own Discord bot! ๐ŸŽ‰

troubleshooting

  • Remove bots in your server that may conflict in functionality, e.g. multiple reaction role bots.
  • Use Git Bash instead of the Command Prompt (cmd.exe) if you are on Windows.
  • Check that your:
    • node version is =>16.11.0 by running node -v.
    • npm version is >=7.0.0 by running npm -v.
  • If running the application outputs:
    • Error: Cannot find module '...', try running npm i in the project directory.
    • DiscordAPIError: Missing Permissions, verify your bot has the correct Manage permissions.

discord-bot-v14's People

Contributors

srcrow02 avatar

Stargazers

 avatar

Watchers

 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.