如何将不和谐消息对象转换为字符串?

How to convert a discord message object into a string?

我正在使用模块 aiml.

中的方法 kernel.respond(message)

这里的message变量是discord.message.Message类型 但是方法 kernel.respond(message) 只能有一个字符串参数。

如何将 discord.message.Message 对象转换为字符串?

您很可能想要获取实际的消息字符串,而不是将 Message 对象转换为字符串表示形式。你应该看看 the documentation to find how to do it. Specifically, the documentation of the Message class 有一些很好的信息。

如果你有discord.Message instance, then you can use content获取邮件正文的字符串表示

content = message.content