【发布时间】:2021-03-31 13:54:09
【问题描述】:
提前感谢任何阅读本文的人
我想让我的不和谐机器人遵循用户回复功能:
this is how I wanted it to be like
对于示例中没有使用真正的机器人表示歉意。运行 Opera 时无法打开或运行代码。
这是我目前编写的代码
if "ngab" in message.content or "Ngab" in message.content or "NGAB" in message.content:
content=message.content.lower()
final=content.replace("ngab",":ng::ab:")
if len(final)<=2000:
await message.delete()
await message.channel.send(f'{message.author.mention}: {final}')
else:
await message.reply(f"too long :ng::ab: {message.author.mention}")
当我用“ngab”回复另一个用户时,机器人只会重复消息的内容,但我希望它像我发送的消息一样回复。
我不知道如何达到预期的效果,我只知道如何让机器人回复相应的消息。
感谢任何可以提供帮助的人,为我在这个问题中犯的任何错误道歉,这是第一次在这里提问。 :)
【问题讨论】:
标签: python discord.py