1#If you havent already install discord.py using pip install discord.py
2#Then import discord
3#Then Import commands
4import discord
5from discord.ext import commands
6#Create your bot instinct
7#With the bot Prefix set to !
8#You can change it to your choice
9client = commands.Bot(command_prefix='!')
10client.remove_command('help')
11#This is an event when the bot logs in this help to check if
12#the bot is running correctly
13@client.event
14async def on_ready():
15 print('Logged on as Stars Bot')
16#This is a basic commad that returns the bots ping
17@client.command()
18async def ping(ctx):
19 await ctx.send(f'Ping is `{round(client.latency * 1000)}` ms ')
20#Change the Your token here with the token found in your discord developer portal
21#https://discord.com/developers/applications here is a link
22client.run('Your Token here')