Search code examples
pythonpython-3.xdiscord.pyaiml

How to convert a discord message object into a string?


I'm using the method kernel.respond(message) from the module aiml.

the message variable here is of type discord.message.Message but the method kernel.respond(message) can only have a string argument.

How can I convert the discord.message.Message object into string?


Solution

  • If you have a discord.Message instance, then you can use content to get the string representation of the message body

    content = message.content