Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Audio don't play / Updatepresence don't work #2

Open
julesnln opened this issue Jul 20, 2020 · 5 comments
Open

Audio don't play / Updatepresence don't work #2

julesnln opened this issue Jul 20, 2020 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@julesnln
Copy link

julesnln commented Jul 20, 2020

Hi !
Thanks for keep discordphp up !

I made a script for when using !vocal [id of channel] the bot came and play sound
but i got no sound when bot connect and no error in console
here is my script

if(strstr($message->content, '!vocal')){
if($message->author->id == "210584395680055296"){
$vowels = array("!vocal ");
$join = str_replace($vowels, "", $message->content);
$guild = $discord->guilds->get('name', 'Entre potes');
$channel = $guild->channels->get('id', $join);
$discord->joinVoiceChannel($channel)->then(function (VoiceClient $vc) use ($channel) {
echo 'Joined '.$channel->name.' voice channel'.PHP_EOL; // Runs fine
$vc->setFrameSize(40)->then(function () use ($vc) {
$vc->playFile('meme-original-scream.mp3')->then(function () {
echo 'Playing test on '.$channel->name.' voice channel.\r\n'; // Not being executed
});
});
});

}else{ $message->channel->sendMessage("ta pa la perm fdp ! (seul lil french a la perm)"); }
}

Same problem with Updatepresence, i use the script in the wiki but nothing happend.

(sorry for bad english im french lol)
Thanks :)

@julesnln julesnln changed the title Audio don't play Audio don't play / Updatepresence don't work Jul 21, 2020
@julesnln
Copy link
Author

same for sendFile

@Thorrdu
Copy link
Collaborator

Thorrdu commented Jul 21, 2020

Hello,

UpdatePresence has been reported ans it will be fixed soon

Unless isn't already fixed when you read this message, you can fix it this way:
On rocketmates/discord-php/src/Discord/WebSockets/Events/PresenceUpdate.php
Line: 52
Remplace this line with:
'nick' => (isset($presenceAttributes['nick']))?$presenceAttributes['nick']:'',

A better fix may occur soon by the dev.

Have a good day

@oliverschloebe
Copy link

oliverschloebe commented Jul 21, 2020

Hi Jules, using the VoiceClient requires some additional modules to be installed: https://discordphp.readme.io/docs/requirements Do you have them installed?

Also, you seem to be trying to play the MP3 file without providing a specific path: $vc->playFile('meme-original-scream.mp3') If you're not running the script from the same folder the MP3 file is located it won't find the file.

@oliverschloebe oliverschloebe added the question Further information is requested label Jul 21, 2020
@julesnln
Copy link
Author

Thanks Thorrdu i will try
Olivier i install all depencies and the file is in the same folder

@julesnln
Copy link
Author

Oh and the sendfile don't work too :(

@oliverschloebe oliverschloebe added bug Something isn't working help wanted Extra attention is needed labels Jul 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants