discord-php / DiscordPHP

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

Revert "Static method to get loop" #1121

Closed key2peace closed 1 year ago

key2peace commented 1 year ago

Reverts discord-php/DiscordPHP#1120

SQKo commented 1 year ago

As a note in future: I know the factory was deprecated, I did this intentionally long ago to fix a weird issue and compatibility with those using older dependencies and various use case of loop options/async lib and php < 8.1

As soon we have minimum 8.1, this will be no longer issue. But at the same time the options would not be actually needed anymore in future (no more $discord(['loop' => $loop]);) and another fun fact is that we would not need the $discord->run() anymore (You can try it already if you are on php 8.1+ with latest react loop lib + remove the $discord->run() from your code)