Answers for " command promt bot"

2 basic command

#If you havent already install using pip install
#Then import discord
#Then Import commands
import discord
from discord.ext import commands
#Create your bot instinct
#With the bot Prefix set to !
#You can change it to your choice
client = commands.Bot(command_prefix='!')
#This is an event when the bot logs in this help to check if 
#the bot is running correctly
async def on_ready():
    print('Logged on as Stars Bot')
#This is a basic commad that returns the bots ping
async def ping(ctx):
    await ctx.send(f'Ping is `{round(client.latency * 1000)}` ms ')
#Change the Your token here with the token found in your discord developer portal
# here is a link'Your Token here')
Posted by: Guest on July-12-2021

Python Answers by Framework

Browse Popular Code Answers by Language