Undefined variable $channel in /root/test/vendor/team-reflex/discord-php/src/Discord/WebSockets/Events/MessageCreate.php on line 72
While these code seems fine (even the syntax is OK and no compile error), for unknown reasons sometimes they are being undefined. I suspect it has something to do with the react/async coroutines yield when the variable is prepared in the if condition scope like that, does not guarantee it to be set outside the scope.
Reported by Discord Member Tady#5553
While these code seems fine (even the syntax is OK and no compile error), for unknown reasons sometimes they are being undefined. I suspect it has something to do with the react/async coroutines
yield
when the variable is prepared in the if condition scope like that, does not guarantee it to be set outside the scope.So I added
isset()
as a safe workaround.Tested.