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