Voice channels

Posted in General by VenomPCPL Sun Mar 18 2018 12:50:34 GMT+0000 (UTC)·Viewed 129 times

Hello. I'm learning writing discord bots in php. When I added the code: $ channel = 361122981961007105; $ discord-> joinVoiceChannel ($ channel) -> then (function (VoiceClient $ vc) { echo "Joined voice channel. \ r \ n"; $ VC> playFile ( 'myfile.mp3'); }, function ($ e) { echo "There was an error joining the voice channel: {$ e-> getMessage ()} \ r \ n"; }); This is the error popping up in the console: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Discord \ Discord :: joinVoiceChannel () must be an instance of Discord \ Parts \ Channel \ Channel, integer given, called in /root/bot/bot.php on line 13 and defined in /root/bot/vendor/team-reflex/discord-php/src/Discord/Discord.php:1015 Stack trace: # 0 /root/bot/bot.php(13): Discord \ Discord-> joinVoiceChannel (361122981961007105) # 1 {main} thrown in /root/bot/vendor/team-reflex/discord-php/src/Discord/Discord.php on line 1015
  
Markdown is allowed