Closed glieske closed 8 years ago
Don't think this is happening anymore, talk to us in the Discord API server if it still does.
I'm having exactly the same issue:
PHP Fatal error: Uncaught Error: Call to a member function push() on null in /srv/link/mikubot/mikubot/vendor/team-reflex/discord-php/src/Discord/Parts/Channel/Channel.php:436
Stack trace:
#0 /srv/link/mikubot/mikubot/vendor/team-reflex/discord-php/src/Discord/Parts/Channel/Message.php(81): Discord\Parts\Channel\Channel->sendMessage('<@1473357399217...')
#1 /srv/link/mikubot/mikubot/src/bot.php(57): Discord\Parts\Channel\Message->reply('pong!')
#2 [internal function]: {closure}(Object(Discord\Parts\Channel\Message), Object(Discord\Discord), Object(Discord\Discord), Object(Discord\WebSockets\WebSocket))
#3 /srv/link/mikubot/mikubot/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(64): call_user_func_array(Object(Closure), Array)
#4 /srv/link/mikubot/mikubot/vendor/team-reflex/discord-php/src/Discord/WebSockets/WebSocket.php(791): Evenement\EventEmitter->emit('MESSAGE_CREATE', Array)
#5 /srv/link/mikubot/mikubot/vendor/team-reflex/discord-php/src/Discord/WebSockets/WebSocket.php(284): Discord\WebSockets\WebSocket- in /srv/link/mikubot/mikubot/vendor/team-reflex/discord-php/src/Discord/Parts/Channel/Channel.php on line 436
I made sure I have the newest version, I even tested a dev version. On my test guild it instantly crashes. I fear the ticket has to be reopened.
Could you come onto the Discord API server and ask for help in #php_discordphp? @haolink
I was asking - and barely got replies. And sadly not helpful ones. I dug in deep using xdebug and I found the issue.
DiscordPHP used APC as a cache to store messages in. As the APC module was loaded, commands such as if (function_exists('apc_cache_info')) worked.
However, in my configuration apc.enable_cli was NOT enabled. So while the APC module was enabled, APC itself was not enabled. Switching this and it started working.
PHP : PHP 7.0.6-1+donate.sury.org~xenial+1 (cli) ( NTS ) Distributor ID: Ubuntu Description: Ubuntu 16.04 LTS Release: 16.04 Codename: xenial
init.php is almost the same as basic.php from examples
bot answers one time, after that crashes