How To Use Discord Bot Client
Type npm install to install the required node modules for this application.
How to use discord bot client. Self bot bot self token dbl token set this to your dbl token self dblpy dbl dblclient self bot self token autopost true autopost will post your guild count every 30 minutes async def on guild post. Bot instances are technically client instances which are lower level and were once the only connections between discord py and discord. Create a new application. Print server count posted successfully def setup bot. Visit the discord applications portal.
Handles interactions with the top gg api def init self bot. Let s create a new application by clicking the new. Give the application a name this will be the bot s initial username. You ll want to make a note of the client id and secret which you should keep a secret of course. The first step is to make sure you have a server where you have the ability to add people to it you ll need this as you ll need to be able to invite your bot.
Import dbl import discord from discord ext import commands class topgg commands cog. This will bring up the discord developer dashboard and you will see all the bots that you created. To register the bot go to the discord developers portal and log in with your account. First we need to create the bot instance connect to your discord account on a browser this cannot be done through the discord client app. A discord token bot is a key to access the discord bot and is used inside the bot code to send the commands back and then ahead to the api.
On the left hand side under settings click bot. Download this git and extract it into a folder. After logging in you should be able to see the dashboard. Open your terminal command prompt then use cd to open the directory of your folder. Please follow the steps.
Create a text file called token txt and type your bot user s token in the file. Then head to the developer s tab. Head over to discord s bot portal and create a new application. Define token as your discord bot token bot run token doing this creates a new bot instance that serves as the connection to discord. We can use this instance to create event listeners and commands.