1#Anything commented out is optional
2
3import discord
4from discord.ext import commands
5
6bot = commands.Bot(command_prefix='prefix here')
7
8@bot.event
9async def on_ready():
10# await bot.change_presence(activity=discord.Game(name="Rich Presence Here"))
11 print('Logged in as: ' + bot.user.name)
12 print('Ready!\n')
13
14@bot.command()
15async def commandname(ctx, *, somevariable)
16#If you don't need a variable, then you only need (ctx)
17# """Command description"""
18 Code goes here
19 await ctx.send('Message')
20
21bot.run('yourtoken')
1import discord
2from discord.ext import commands
3
4client = commands.Bot(comand_prefix='bot prefix here') # You can choose your own prefix here
5
6@client.event()
7async def on_ready(): # When the bot starts
8 print(f"Bot online and logged in as {client.user}")
9
10# A simple command
11@client.command(aliases=["ms", "aliases!"]) # You make make the command respond to other commands too
12async def ping(ctx, a_variable): # a_variable is a argument you use in the command
13 await ctx.send(f"Pong! {round(client.latency * 1000)}ms. Your input was {a_variable}")
14
15client.run('your token here') # Running the bot