discord.py 中的 Discord Selfbot 未找到重写命令

Discord Selfbot in discord.py rewrite command not found

我正在尝试为 discord.py 重写中的 discord 创建一个 selfbot,它给了我这个错误:

Ignoring exception in command None: discord.ext.commands.errors.CommandNotFound: Command "me" is not found

这是我的代码:

from discord.ext import commands

selfbot = commands.Bot(command_prefix = "<.", self_bot = True)

selfbot.event
async def on_ready():
    print(f'IDK Running on: {selfbot.user}')

selfbot.command()
async def test(ctx):
    await ctx.send('Off.')

selfbot.command()
async def me(ctx):
    ctx.send(f'You are {selfbot.user}')

token = 'token here'
selfbot.run(token, bot = False)```

你不见了 @。应该是

from discord.ext import commands

selfbot = commands.Bot(command_prefix = "<.", self_bot = True)

@selfbot.event
async def on_ready():
    print(f'IDK Running on: {selfbot.user}')

@selfbot.command()
async def test(ctx):
    await ctx.send('Off.')

@selfbot.command()
async def me(ctx):
    ctx.send(f'You are {selfbot.user}')

token = 'token here'
selfbot.run(token, bot = False)

注意:您缺少命令装饰器的主要内容,@,没有它,您的命令将不会注册为命令或事件