discord bot application code example

Example 1: how to disable a discord bots OAuth2 code

import base64

API_ENDPOINT = 'https://discord.com/api/v6'
CLIENT_ID = '332269999912132097'
CLIENT_SECRET = '937it3ow87i4ery69876wqire'

def get_token():
  data = {
    'grant_type': 'client_credentials',
    'scope': 'identify connections'
  }
  headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
  }
  r = requests.post('%s/oauth2/token' % API_ENDPOINT, data=data, headers=headers, auth=(CLIENT_ID, CLIENT_SECRET))
  r.raise_for_status()
  return r.json()

Example 2: how to make a discord bot

//discord.js is probably the easiest to learn. To install do this
//in command prompt (Windows, Linux) or terminal (Mac)

npm init
//and then
npm i discord.js

//after that just read the discord.js.org documentation
//and follow a couple yt guides, maybe join some servers.

Example 3: how to make disord bot

follow this https://discordpy.readthedocs.io/en/latest/discord.html to make bot account 
use discord api of your laugaungue of choice
discord.py https://discordpy.readthedocs.io/en/latest/index.html
discord.js  https://discord.js.org/#/

Tags:

Misc Example