
Recherche avancée
Autres articles (69)
-
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 (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (6989)
-
Why does My Discord bot stop playing music
27 septembre 2021, par KonglnwzaSo My Discord bot will be able to play music for a while then it will stop and i have to restart the bot to fix it.
And if it stopped then i use command skip it will crash the bot with the errors below


C:\Users\User\Desktop\Discord bot\Song\play.js:96
 server_queue.connection.dispatcher.end();
 ^

TypeError: Cannot read property 'end' of null
 at skip_song (C:\Users\User\Desktop\Discord bot\Song\play.js:96:40)
 at Object.execute (C:\Users\User\Desktop\Discord bot\Song\play.js:65:47)
 at Client.<anonymous> (C:\Users\User\Desktop\Discord bot\bot.js:78:74)
 at Client.emit (node:events:394:28)
 at MessageCreateAction.handle (C:\Users\User\Desktop\Discord bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
 at Object.module.exports [as MESSAGE_CREATE] (C:\Users\User\Desktop\Discord bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
 at WebSocketManager.handlePacket (C:\Users\User\Desktop\Discord bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
 at WebSocketShard.onPacket (C:\Users\User\Desktop\Discord bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
 at WebSocketShard.onMessage (C:\Users\User\Desktop\Discord bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
 at WebSocket.onMessage (C:\Users\User\Desktop\Discord bot\node_modules\ws\lib\event-target.js:132:16)
</anonymous>


I guess the problem is something with ffmpeg or i must have some npms more.


npm i already installed


- 

- discord.js
- ytdl-core
- ytdl-search
and also i already installed ffmpeg in my computer and set the path








i want to ask that do i have to install any npms more ? or anyone know how to fixed this problem ?


const ytdl = require('ytdl-core');
const ytSearch = require('yt-search');

const queue = new Map();

module.exports = {
 name: 'play',
 aliases: ['skip', 'stop', 'queue', 'leave', 'join'],
 description: 'Joins and play',
 async execute(message, args , cmd, client, Discord){
 const voice_channel = message.member.voice.channel;
 if(!voice_channel) return message.channel.send('เข้าไปอยู่ในดิสก่อนดิวะ :angry: ');//you must in voice channel
 
 
 const server_queue = queue.get(message.guild.id);
 if(cmd==='play' || cmd==='p'){
 if(!args.length) return message.channel.send('จะเปิดอะไรล่ะพี่ :triumph:');//you must have argument
 let song = {};

 if(ytdl.validateURL(args[0])){
 const song_info = await ytdl.getInfo(args[0]);
 song = {title: song_info.videoDetails.title, url: song_info.videoDetails.video_url}
 } else {
 const videoFinder = async (query) => {
 const videoResult = await ytSearch(query);
 return (videoResult.videos.length > 1) ? videoResult.videos[0] : null;
 }

 const video = await videoFinder(args.join(' '));
 if(video){
 song = {title: video.title, url: video.url}
 
 } else{
 message.channel.send('หาไม่เจอ :cry: ');//cant find song
 }
 }
 //const connection = await voiceChannel.join(); 
 if(!server_queue){
 const queue_constructor = {
 voice_channel: voice_channel,
 text_channel: message.channel,
 connection: null,
 songs: []
 }

 queue.set(message.guild.id, queue_constructor);
 queue_constructor.songs.push(song);

 try{
 const connection = await voice_channel.join();
 queue_constructor.connection = connection;
 video_player(message.guild, queue_constructor.songs[0]);
 } catch (err) {
 queue.delete(message.guild.id);
 message.channel.send('error');
 throw err;
 }
 } else{
 server_queue.songs.push(song);
 return message.channel.send(`:regional_indicator_k: :regional_indicator_o: :regional_indicator_n: :regional_indicator_g: :star_struck: **${song.title}** ใส่เข้าคิวแล้ว`)//added to queue
 }
 

 }
 else if(cmd === 'skip' || cmd ==='s') skip_song(message, server_queue);
 else if(cmd === 'clear' || cmd==='c') clear_song(message, server_queue);
 else if(cmd === 'join') join_song(message);
 else if(cmd === 'leave') leave_song(message);
 else if(cmd === 'queue' || cmd ==='q') queue_show(message,server_queue,Discord);


 }
}

const video_player = async (guild, song) => {
 const song_queue = queue.get(guild.id);

 if(!song){
 //song_queue.text_channel.send('ไปละบาย :kissing_heart: ');
 song_queue.voice_channel.leave();
 queue.delete(guild.id);
 return;
 }
 const stream = ytdl(song.url,{filter: 'audioonly'},{ highWaterMark: 1<<25 });
 song_queue.connection.play(stream, { seek: 0, volume: 0.5 })
 .on('finish', () => {
 song_queue.songs.shift();
 video_player(guild, song_queue.songs[0]);
 });
 await song_queue.text_channel.send(`:regional_indicator_k: :regional_indicator_o: :regional_indicator_n: :regional_indicator_g: :sunglasses: กำลังเล่นเด็ก ***${song.title}***`);//playing song
}

const skip_song = (message, server_queue) => {
 if(!message.member.voice.channel) return message.channel.send('เข้าดิสก่อนดิ :angry: ');//you must be in voice channel
 if(!server_queue) return message.channel.send('ไม่มีเพลงในคิวแล้ว :relieved: ');//no song in queue
 server_queue.connection.dispatcher.end();
}

const clear_song = (message, server_queue) => {
 if(!message.member.voice.channel) return message.channel.send('เข้าดิสก่อนดิ :angry: ');//you must be in voice channel
 if(!server_queue) return message.channel.send('ไม่มีเพลงในคิวแล้ว :relieved: ');//no song in queue
 server_queue.songs = [];
 server_queue.connection.dispatcher.end();
}

const join_song = (message) => {
 if(!message.member.voice.channel) return message.channel.send('เข้าดิสก่อนดิ :angry: ');//you must be in voice channel
 message.member.voice.channel.join();
}

const leave_song = (message) => {
 if(!message.member.voice.channel) return message.channel.send('เข้าดิสก่อนดิ :angry: ');//you must be in voice channel
 message.member.voice.channel.leave();
}

const queue_show = (message,server_queue,Discord) => {
 if(!server_queue) return message.channel.send('ไม่มีเพลงในคิวแล้ว :relieved: ');//no song in queue
 const queueList = server_queue.songs.map((song, i) => `[${++i}] - ${song.title}`);
 const queueEmbed = new Discord.MessageEmbed()
 .setDescription(queueList);
 message.channel.send(queueEmbed);
}```



-
Music discord.js bot : The "url" argument must be of type string
4 juin 2020, par NathanI am trying to make a working music Discord bot with discord.js and ffmpeg but I keep getting the error
TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
. The error occurs when I try the commandplay
, after the bot joins the voice channel and sendퟎ
-
Own music discord bot : FFmpeg/avconv not found. Can someone help me ?
23 mai 2020, par CreepyGamerCatI guess the code is right because the bot finds a song and also joins a voice channel, but it can't play songs, because of this error. The ffmpeg.exe, ffmplay.exe, ffm.probe.exe and YouTube-dl.exe files are in the same folder. (directory : desktop>Discord Bot>node_modules>bin.) Maybe this is a wrong folder, I forgot a important file or whatever. I hope you can help. I use Visual Studio Code in JavaScript.