我正在用Python(v.3.6.1)编写一个Discord bot。它的一个功能是检测在一个信道中发送的所有消息,对它们进行处理,然后对所述信道中的消息作出响应。(至少,这是我想要它做的事情。)
我试过了:
@bot.event
async def on_message(message):
await bot.say(message.content)
函数在消息被发送时响应,但不是以我希望的方式。我得到了一个错误:
discord.errors.InvalidArgument: Destination must be Channel, PrivateChannel, User, or Object. Received NoneType
我该怎么解决这个问题?非常感谢!在
不能在命令之外使用
bot.say
。在http://discordpy.readthedocs.io/en/latest/faq.html#can-i-use-bot-say-in-other-places-aside-from-commands
要让bot重复发送的每个消息,可以使用
send_message
。下面是一个例子。在相关问题 更多 >
编程相关推荐