【发布时间】:2020-12-03 18:11:15
【问题描述】:
我正在尝试发出一个命令,让我的 Discord 机器人重复我所说的话。但是,我只希望它为我工作。当我将 (ctx, *, message) 作为参数时,出现类似于“未定义消息”的错误。但是当唯一的参数是 (message) 时,它可以打印消息作者。但是现在当我运行命令时,机器人在 Discord 聊天中说这个错误:<discord.ext.commands.context.Context object at 0x0000014E1DE3D940>
这是我的代码:
@client.command()
async def say(message):
if str(message.author) == "ASOwnerYT#7799":
await message.channel.send(str(message))
else:
print(f'{message.author} tried to use the say command!')
【问题讨论】:
标签: python python-3.x discord.py discord.py-rewrite