Compatibility Symfony 5
hugoguitton-x opened this issue · 5 comments
hugoguitton-x commented
oliverschloebe commented
Hi @hugoguitton-x, just added Symfony 5 support. Please check, thank you!
hugoguitton-x commented
Hi @oliverschloebe thanks for the modification. I can install it thanks to composer, however I can't use it with Symfony apparently.
I have the following message: "DiscordPHP will not run on a webserver. Please use PHP CLI to run a DiscordPHP bot."
oliverschloebe commented
I have the following message: "DiscordPHP will not run on a webserver. Please use PHP CLI to run a DiscordPHP bot."
That is because you can't run DiscordPHP in the browser. You have to run it using CLI.
hugoguitton-x commented
Okay. I'm dumb my bad. This code works fine !
$discord = new Discord([
'token' => 'bot-token',
]);
$discord->on('ready', function ($discord) {
echo "Bot is ready!", PHP_EOL;
// Listen for messages.
$discord->on('message', function ($message, $discord) {
echo "{$message->author->username}: {$message->content}",PHP_EOL;
});
});
$discord->run();
oliverschloebe commented
No worries! Glad you got it working. 👍🏻