
Recherche avancée
Autres articles (34)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...)
Sur d’autres sites (7149)
-
Discord.js music bot : TypeError : this.inputMedia.pipe is not a function
7 août 2019, par IvsI’m writing a music Discord bot using Discord.js. The bot uses ytdl-core, node-opus, and I have installed ffmpeg on my OS (Ubuntu 19.04). When I try to make the bot join a voice channel and start playing a YouTube URL, it throws the following error :
TypeError: this.inputMedia.pipe is not a function
at FfmpegProcess.connectStream (/home/ivan/.../node_modules/discord.js/node_modules/prism-media/src/transcoders/ffmpeg/FfmpegProcess.js:73:21)
at new FfmpegProcess (/home/ivan/.../node_modules/discord.js/node_modules/prism-media/src/transcoders/ffmpeg/FfmpegProcess.js:28:14)
at FfmpegTranscoder.transcode (/home/ivan/.../node_modules/discord.js/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:34:18)
at MediaTranscoder.transcode (/home/ivan/.../node_modules/discord.js/node_modules/prism-media/src/transcoders/MediaTranscoder.js:27:31)
at Prism.transcode (/home/ivan/.../node_modules/discord.js/node_modules/prism-media/src/Prism.js:13:28)
at AudioPlayer.playUnknownStream (/home/ivan/.../node_modules/discord.js/src/client/voice/player/AudioPlayer.js:97:35)
at VoiceConnection.playStream (/home/ivan/.../node_modules/discord.js/src/client/voice/VoiceConnection.js:478:24)
at voiceChannel.join.then.connection (/home/ivan/.../commands/play.js:32:47)
at process._tickCallback (internal/process/next_tick.js:68:7)Here is my code :
const ytdl = require("ytdl-core");
exports.run = (client, message, args, config) => {
return new Promise((resolve, reject) => {
if (args.length !== 1) {
message.channel.send("Play command takes 1 YouTube link.");
reject("Wrong number of arguments");
return;
}
const voiceChannel = message.member.voiceChannel;
if(!voiceChannel) {
message.channel.send("You need to connect to a voice channel first");
reject("Not connected to voice channel");
return;
}
const perms = voiceChannel.permissionsFor(message.client.user);
if (!perms.has("CONNECT")) {
message.channel.send("You need to add the 'connect' permission for this bot");
reject("NO CONNECT PERMISSION");
return;
}
if (!perms.has("SPEAK")) {
message.channel.send("You need to add the 'speak' permission for this bot");
reject("NO SPEAK PERMISSION");
return;
}
const streamOptions = { seek: 0, volume: 1, passes: 2 };
voiceChannel.join()
.then(connection => {
const stream = ytdl(args[0], {filter: 'audioonly'});
const dispatcher = connection.playStream(ytdl, streamOptions);
dispatcher.on("end", reason => {
console.log("reason: " + reason);
voiceChannel.leave();
})
dispatcher.on("error", err => {
console.log(err);
})
})
.catch(err => console.log(err));
});
}I have tried reinstalling ffmpeg, node and npm, discord.js and node-opus. I have the newest version of Discord.js installed, and ffmpeg version 4.1.3-0ubuntu1. Anyone have any suggestions ?
Thanks.
-
Discord.js : How to play music stream from http?
28 septembre 2019, par Maxim.ZThis is my code :
if (msg.content.includes('*stream')) {
var name=(msg.content).slice(8,80);
if (msg.member.voiceChannel) {
msg.member.voiceChannel.join()
.then(connection => {
console.log(name);
const dispatcher = connection.playFile(name);
dispatcher.setVolume(0.5);
})
.catch(console.log);
} else {
msg.reply('Enter channel first');
}
}When I write in Discord
*stream https://play.sas-media.ru/play
, the console shows the full link (https://play.sas-media.ru/play
), the bot enters the voice channel, but nothing else happens.What am I doing wrong ?
-
Issues with Discord JS Music Bot
5 décembre 2020, par ThresioI am in the process of creating a Discord bot with JS, giving it management, auto role, etc. I just got to the music section of it and I can't quite figure out whats wrong.



I believe I have installed FFmpeg correctly, as I have access to it from within the terminal. I have also used npm to bring ytdl-core and opusscript into my program.



What this should do is make the bot join the chat, then play the Youtube link. Currently, I am not error checking the second argument as I just wanted to get it working initially. I have implemented several different instances of .toString() and String() however it always gives the same error listed below.



. The program still throws this error :



TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object

C:\Users\Thresio's PC\Desktop\Discord Bot\node_modules\opusscript\build\opusscript_native_wasm.js:8
var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var
key;for(key in Module){if(Module.hasOwnProperty(key))
{moduleOverrides[key]=Module[key]}}Module["arguments"]=
[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow) {throw
toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var 
ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var 
ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof 
importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof 
process.versions==="object"&&typeof 
process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONM
ENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var
scriptDirectory="";function locateFile(path){i
abort(TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type 
string. Received type object). Build with -s ASSERTIONS=1 for more info. 




Here is my code for calling play :



case 'play':

 function play(connection, message){
 var server = servers[message.guild.id];

 server.dispatcher = connection.playStream(ytdl(server.queue[0], {filter: 'audioonly'}));

 server.queue.shift();

 server.dispatcher.on('end', function(){
 if(server.queue[0]){
 play(connection, message);
 }else {
 connection.disconnect();
 }
 })
 }

 if(!args[1]){
 message.channel.send('You need to provide a link!');
 return;
 }

 if(!message.member.voiceChannel){
 message.channel.send('You must be in a voice channel to play music!');
 return;
 }

 if(!servers[message.guild.id]) servers[message.guild.id] = {
 queue: []
 }

 var server = servers[message.guild.id];

 server.queue.push(args[1]);

 if(!message.guild.voiceConnection) message.member.voiceChannel.join().then(function(connection){
 play(connection, message);
 })
 break;




If anyone could assist with this, I would be very grateful.



EDIT : I unfortunately never figured out my main issue, but I have now found code that works (unlike mine :/).
For anyone else having this issue, I suggest using the code found here.
Works like a charm !