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')
1
2#Import essentials
3import discord
4from discord.ext import commands
5import asyncio
6#Some things that makes your life easier! (aliases to make code shorter)
7client = commands.Bot(command_prefix='!') #change it if you want
8token = 'YOUR TOKEN HERE' #Put your token here
9#Making a first text command! (Respond's when a user triggers it on Discord)
10@client.command()
11async def hello(ctx):
12 await ctx.send('Hello I am a Test Bot!')
13#Tell's us if the bot is running / Runs the bot on Discord
14@client.event
15async def on_ready():
16 print('Hello, I am now running')
17
18
19
20client.run(token)