how to make a discord bot in python

24

import discord
from discord.ext import commands
bot = commands.Bot("!")
@bot.command()
async def test(ctx):
   print('hello')
bot.run('token')
from nextcord.ext import commands

bot = commands.Bot(command_prefix='$')

@bot.command()
async def test(ctx):
    pass

# or:

@commands.command()
async def test(ctx):
    pass

bot.add_command(test)

Comments

Submit
0 Comments