Nathan Oldridge | Blog


[SOLVED] Empty string message.content using discord.py in 2023


Why is my message.content returning an empty string (Python, 2023)?

This took me a while to debug, and most internet search results are from before Discord changed messages to a Privileged Intent.

Step 1: Ensure your bot has the privileged intent enabled:

Step 2: Ensure you give your bot that intent in the code:

message.content will return an empty string until you give your bot message_content=True as an intent in your code.

I hope this saves you some grief. It took me 1 hour to track down this solution in an obscure Reddit thread (which was actually for JavaScript).