If you examine your code carefully, you'll see that you are assigning the command to the client
object, but running the bot
object. You need to do client.run("<TOKEN>")
as another commenter suggested.
You also don't need bot = discord.Client()
at all. discord.Client
is a parent class with less abilities. I encourage you to rename client
to bot
though.
from discord.ext import commands
bot = commands.Bot(command_prefix='V!')
@bot.command(name='repeat')
async def _repeat(ctx, arg):
await ctx.send(arg)
bot.run('TOKEN')
Notice now there's no import discord
or discord.Client
anywhere.
See: What are the differences between Bot and Client?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…