Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.86k stars 3.76k forks source link

message.content blank #6820

Closed mcg88 closed 3 years ago

mcg88 commented 3 years ago

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

Checklist

Additional Context

No response

mericausa commented 3 years ago

I have the same issue. No content from discord

imvaskel commented 3 years ago

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

athyk commented 3 years ago

Same issue but with message.embeds

mcg88 commented 3 years ago

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

apple502j commented 3 years ago

Can you print(repr(message))?

mcg88 commented 3 years ago

<Message id=837697805711441922 channel=<TextChannel id=697135489484062762 name='t_chat' position=27 nsfw=True news=False category_id=666511732570718209> type=<MessageType.default: 0> author=<Member id=773294873422856202 name='LVP' discriminator='0899' bot=False nick=None guild=<Guild id=428232997737594901 name='AT' shard_id=None chunked=False member_count=212629>> flags=<MessageFlags value=0>>

lekt9 commented 3 years ago

Recently started having a similar issue but with embeds as well.

rekeshali commented 3 years ago

Having a similar issue, except I can get the message content from my own messages, nobody else's

ardlank commented 3 years ago

Having the same issue. Message.content and message.embeds is empty. please help

ardlank commented 3 years ago

@rekeshali is correct. only works on my messages

apple502j commented 3 years ago

Can anyone reproduce this on actual bots (not on user-account bots/"selfbots")?

Rapptz commented 3 years ago

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.