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