Hi all. I'm testing an application and I need to receive a message from a bot in a separate channel. Regular messages are successfully received by the MESSAGE_CREATE event. How can I get such an event?
My code does not react to the appearance of such an event.
include __DIR__.'/vendor/autoload.php';
use Discord\Discord;
use Discord\Parts\Channel\Message;
use Discord\WebSockets\Intents;
use Discord\WebSockets\Event;
use Discord\Parts\Interactions\Interaction;
$discord = new Discord([
'token' => 'TOKEN',
'intents' => Intents::getDefaultIntents() | Intents::GUILD_MEMBERS | Intents::GUILD_PRESENCES | Intents::GUILDS | Intents::GUILD_BANS,
'loadAllMembers' => true
]);
$discord->on('ready', function (Discord $discord) {
$discord->on(Event::INTERACTION_CREATE, function (Message $interaction, Discord $discord) {
echo 'INTERACTION_CREATE'.PHP_EOL;
});
});
$discord->run();
Hi all. I'm testing an application and I need to receive a message from a bot in a separate channel. Regular messages are successfully received by the MESSAGE_CREATE event. How can I get such an event?
My code does not react to the appearance of such an event.