VoiceConnection est le bot dans un salon vocal d’un serveur : ce qu’il y joue, et comment il part. channel.join() en donne une ; guild.voice est celle d’un serveur.
Propriétés
Helpers
toJSON()
console.log et JSON.stringify : le serveur, le salon et ce qui joue, jamais la session ni ses clés.
Actions
play()
public/ (asset('music/intro.ogg')), un fichier envoyé sur Discord (l’option attachment d’une commande) ou un lien. L’Opus (.ogg, .webm) est envoyé tel quel ; tout le reste est converti avec ffmpeg, qui doit alors être installé. Arrête ce qui jouait. Se résout quand c’est fini, arrêté, ou qu’un autre play() le remplace.
Documentation de Discord
pause()
resume() reprend de là.
resume()
stop()
play() se résout.
leave()
Types
AudioSource
play() : un fichier de public/ (asset('music/intro.ogg')), un fichier envoyé sur Discord (l’option attachment d’une commande, ou l’un des message.attachments), ou un lien qui commence par https://. Voir Attachment.
JoinOptions
Ce que prendjoin().
true, puisque le bot ne fait que jouer.Erreurs
join() et play() lèvent une erreur qui dit quoi faire ; elle est affichée avec la ligne de votre code, comme les autres.
The bot can't join Lounge: it needs the Connect permission there.
The bot can't join Lounge: it needs the Connect permission there.
play() dit la même chose avec Parler (Speak).The bot can't join Lounge: it is full (5 people), and the bot does not have the Move Members permission that lets it in anyway.
The bot can't join Lounge: it is full (5 people), and the bot does not have the Move Members permission that lets it in anyway.
Discord did not let the bot join Lounge within 10 s.
Discord did not let the bot join Lounge within 10 s.
public/x.mp3 is not an Opus file (.ogg or .webm), and ffmpeg is not installed to convert it.
public/x.mp3 is not an Opus file (.ogg or .webm), and ffmpeg is not installed to convert it.
.ogg Opus.ffmpeg could not read public/x.wav: …
ffmpeg could not read public/x.wav: …
… is a web page, not a sound: give the link of an audio file or of a stream, or send the file.
… is a web page, not a sound: give the link of an audio file or of a stream, or send the file.
… could not be downloaded: the server answered 404.
… could not be downloaded: the server answered 404.
play() takes a file of public/, like play(asset('music/intro.ogg')), a file sent on Discord, or a link starting with https://.
play() takes a file of public/, like play(asset('music/intro.ogg')), a file sent on Discord, or a link starting with https://.
play() a reçu autre chose, comme un chemin écrit à la main. Utilisez asset().The bot is no longer in this voice channel: join it again with channel.join().
The bot is no longer in this voice channel: join it again with channel.join().