0
how do i put command in my bot
from discord.ext import commands import asyncio import discord import random """A SIMPLE DISCORD BOT USING DISCORD.PY""" bot=commands.Bot(command_prefix='s.') #command prefix @bot.event async def on_ready(): """Print the bot's name when the bot is ready'""" print(bot.user.name) @bot.command(pass_context=True) async def say(con,*,msg): """Repeats what the user says""" await bot.say(msg) @bot.command(pass_context=True) async def dice(con,x=1,y=6): await bot.say(random.randint(x,y)) bot.run('ur bot token') # ↑that the code ↑ https://code.sololearn.com/cffLFiT5841K/?ref=app
1 Resposta
0
Try with
@bot.command()
async def say(ctx, msg):
await ctx.send(msg)