How To Use Discord Bot Client
We can use this instance to create event listeners and commands.
How to use discord bot client. Optional if this bot will be public tick public bot. Bot instances are technically client instances which are lower level and were once the only connections between discord py and discord. Then head to the developer s tab. Open your terminal command prompt then use cd to open the directory of your folder. Click on add bot.
Handles interactions with the top gg api def init self bot. Let s create a new application by clicking the new. Print server count posted successfully def setup bot. Visit the discord applications portal. Import dbl import discord from discord ext import commands class topgg commands cog.
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. Define token as your discord bot token bot run token doing this creates a new bot instance that serves as the connection to discord. This will bring up the discord developer dashboard and you will see all the bots that you created. Create a new application.
Please follow the steps. Create a text file called token txt and type your bot user s token in the file. You ll want to make a note of the client id and secret which you should keep a secret of course. Give the application a name this will be the bot s initial username. After logging in you should be able to see the dashboard.
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. Head over to discord s bot portal and create a new application. Type npm install to install the required node modules for this application. 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. Download this git and extract it into a folder.