Skip to content

Setting Up a BOT Account

Sachin edited this page Feb 19, 2021 · 3 revisions

How to create a Discord app

Link: https://discordapp.com/developers/applications/me

Step 1: Create App

CREATEAPP

Step 2: Create Bot User + Save IDs & tokens

CREATEBOTUSER

Step 3: Authorize Bot

Use the ClientID you got in the last step, edit this url and authorize the bot on your server: https://discordapp.com/oauth2/authorize?client_id=**281160912305812367**&scope=bot AUTHORIZEBOT

Step 4: Init Bot

  • Use the bot token you got step 2 and replace it from "YOURBOTTOKEN" then copy it.
  • Open a web browser and it's dev console and execute it once.
  • As soon the code is executed the bot should show as online on our discord server.
  • By now it will timeout after some time, but it will be able to send and receive messages from now on.
  • Check if the bot has all permissions it needs like read and write permissions etc.
var ws = new WebSocket('wss://gateway.discord.gg/?v=6&encoding=json');
ws.onopen = () => {
    var mystring = JSON.stringify({
     "op": 2,
     "d": {
     "token": "YOURBOTTOKEN",
     "properties": {
     "$os": "linux",
     "$browser": "sometestingbrowser",
     "$device": "sometestingdevice",
     "$referrer": "",
     "$referring_domain": "",
     },
     "compress": true,
     "large_threshold": 250,
     } 
    });

    ws.send(mystring);
}

INITBOT

Bonus Step:

After a discord update, you need to un-check these options incase they're checked as shown in screenshot below! TROUBLESHOOT

Thanks to Zipcore for creating the page here, Deathknife for creating the page here and KillStr3aK for creating the page here