discord-php / DiscordPHP

An API to interact with the popular messaging app Discord
MIT License
985 stars 236 forks source link

Messages always have empty content field in them #1002

Closed yoraze closed 1 year ago

yoraze commented 1 year ago

Environment

Describe the bug

Messages always have empty content field in them. Everything works fine if I use 7.3.3 instead of dev-master. Dont know where and when the bug happened. (in repository I mean)

To Reproduce

Steps to reproduce the behavior:

$discord->on('message', function(Message $message) : void{
    var_dump($message->content); // Will be always string(0) ""
});
SQKo commented 1 year ago

📌 Content message is returning empty ?

1.

$discord = new Discord([
    'token' => ...,
    'intents' => Intents::getDefaultIntents() | Intents::MESSAGE_CONTENT,
]);
  1. https://discord.com/developers/applications/ > Your Application > Bot > Privileged Gateway Intents > Message Content Intent gambar (more info: https://dis.gd/mcfaq)

Environment

* PHP Version:

  * 7.4.18

* DiscordPHP Version:

  * dev-master#4459c36 (or #d3fbf6e aka latest commit at the moment)

dev-master will require PHP 8.0+

yoraze commented 1 year ago

Oh I see now In #511 message intents disabled by default Thanks!