【发布时间】:2021-10-30 08:14:16
【问题描述】:
我正在尝试创建一个不和谐的机器人并向其添加一些命令,但它似乎不起作用。 我添加了 print 语句来确定是否添加了命令,但它返回 None。在不和谐频道中调用“!hello”会引发 CommandNotFound。
from discord.ext import commands
client = commands.Bot(command_prefix="!")
TOKEN = [some token]
@client.command
async def hello(ctx, arg):
await ctx.channel.send(arg)
print(client.get_command("hello"))
client.run(TOKEN)
【问题讨论】:
标签: python discord discord.py bots