question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

message.content blank

See original GitHub issue

Summary

missing data from discord

Reproduction Steps

Running the code snippet below just prints blanks across multiple servers I’ve tried

Minimal Reproducible Code

`
import discord

class MyClient(discord.Client):
    async def on_ready(self):
        print('Logged on as', self.user)

    async def on_message(self, message):
        print(message.content)

client = MyClient()
client.run('token')
`

Expected Results

should print message

Actual Results

blank

Intents

bot=false

System Information

  • Python v3.8.5-final
  • discord.py v1.6.0-final
  • aiohttp v3.7.3
  • system info: Linux 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 root@ubuntu-s-1vcpu-1gb-nyc1-01:~/discord#

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mcg88commented, Apr 30, 2021

message.content can be blank if the message doesn’t feature any content, eg when the message is exclusively an embed.

Yes, I realize that but in my case this applies to all messages coming through the stream not exclusively embeds or any other message type that would cause the content to be blank. Pure text content is missing

0reactions
Rapptzcommented, Apr 30, 2021

Judging from the comments and the parent issue this seems to only affect self-bots. Self-bots are deprecated and unsupported in v1.7. They are getting removed in v2.0. If this issue can be reproduced with a real bot account then I would have heard about it from official sources and other libraries, but since I haven’t I’m assuming this doesn’t apply to real bots.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pycord message.content is empty - python - Stack Overflow
It seems using discord.py message.content will always be empty. ... You can solve this by enabling the MESSAGE CONTENT INTENT for your bot ......
Read more >
message.content is always empty? : r/Discord_Bots - Reddit
OK so basically here's my code, when I print message.content to the console it always prints an empty string no matter what my...
Read more >
OS12 Mail message content is blank - Apple Community
OS12 Mail message content is blank -- updated to 12.5, still a problem. Open Mail, and the sender/subject line appear in the preview...
Read more >
Empty messages from discord - Repl.it Python Discord Bot
It seems that the messages from discord are triggering the code, but there is nothing in message.content. So replies based on content in...
Read more >
Message Content Privileged Intent FAQ - Developers - Discord
If your bot or app is not approved for message content, the following fields of the message object in Gateway and API payloads...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found