
Recherche avancée
Autres articles (67)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (6401)
-
I got that error when i try to play music with my bot on discord
20 septembre 2020, par TheKillerBoss 27(node:10076) UnhandledPromiseRejectionWarning : TypeError : Cannot read property 'id' of undefined
at play (C :\Users\USER\Desktop\Giochi e Programmi\Foto video ecc\Proggetti\Discord-bot\Akagi-chan\Akagi_chan.js:49:51)
at C :\Users\USER\Desktop\Giochi e Programmi\Foto video ecc\Proggetti\Discord-bot\Akagi-chan\Akagi_chan.js:89:17

at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:10076) UnhandledPromiseRejectionWarning : Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id : 1)
(node:10076) [DEP0018] DeprecationWarning : Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

const Discord = require('discord.js');
const bot = new Discord.Client();

const ytdl = require("ytdl-core");

const token = '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'

var versione = '1.0.1';
var autore = 'TheKillerBoss';
var servers = {};

const PREFIX = '!';

bot.on('ready', () =>{
 console.log('Online!');
 bot.user.setActivity('Kawaii!', {type: "PLAYING"});
})

bot.on('message', message=>{

 let args = message.content.substring(PREFIX.length).split(" ");

 switch(args[0])
 {
 case 'help':
 message.channel.send('ping --> pong!')
 message.channel.send('twitch --> canale twitch')
 message.channel.send('twitter --> pagina twitter')
 break;
 case 'ping':
 message.channel.send('pong!')
 break;
 case 'twitch':
 message.channel.send('Segui TheKilleBoss su Twitch! https://twitch.tv/thekillerboss_27')
 break;
 case 'twitter':
 message.channel.send('Segui TheKilleBoss su Twitter https://twitter.com/TheKillerBoss27')
 break;
 case 'versione':
 message.channel.send('Versione: ' + versione)
 break;
 case 'autore':
 message.channel.send('Autore: ' + autore)
 break;
 case 'play':
 function play(connection, message)
 {
 var server = servers(message.guid.id);

 server.dispatcher = connection.play(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("Devi inserire un link!");
 return;
 }

 if(!message.member.voice.channel)
 {
 message.channel.send("Devi essere in un canale vocale!");
 return;
 }

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

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

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

 if(!message.member.voice.connection)message.member.voice.channel.join().then(function(connection){
 play(connection, message);
 })

 
 break;
 
}
})


bot.login(token);



so the bot enters the voice channel but does not start the music and it give me that error.
I removed the token for privacy.


-
Discord BOT Music player : plays 3 songs at once
15 août 2020, par LaCalientaI am developing my Discord bot that plays music, I am using DSahrpPlus as a wrapper and got the bot mostly working


Commands get parsed corecly


using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;

using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
using DSharpPlus.VoiceNext;

using WolfBot.Attributes;
using WolfBot.Commands.Music;

namespace WolfBot.Commands
{
 class MusicCommands : BaseCommandModule
 {
 int SongID = 1;
 MusicPlayer player;
 [Command("join")]
 [RequirePermissionsCustom(Permissions.UseVoice)]
 public async Task Join(CommandContext ctx)
 {
 //Initialize music player
 player = new MusicPlayer(ctx);

 var vnext = ctx.Client.GetVoiceNext();

 var vnc = vnext.GetConnection(ctx.Guild);
 if (vnc != null)
 {
 await ctx.RespondAsync("Already connected in this guild.");
 throw new InvalidOperationException("Already connected in this guild.");
 }

 var chn = ctx.Member?.VoiceState?.Channel;
 if (chn == null)
 {
 await ctx.RespondAsync("You need to be in a voice channel.");
 throw new InvalidOperationException("You need to be in a voice channel.");
 }

 vnc = await vnext.ConnectAsync(chn);
 await ctx.RespondAsync(DiscordEmoji.FromName(ctx.Client, ":ok_hand:")); //-
-
When I try to play my Music Discord Bot it doesn't play music
1er juin 2020, par EthanDevelopsWhen I try to play my Music Discord Bot it doesn't play music. It uses ytdl-core and ffmpeg
My code is :



const Discord = require('discord.js');
const bot = new Discord.Client

const ytdl = require("ytdl-core")


const token = 'API TOKEN'

const PREFIX = '?';

var version = '1.2';

var servers = {};

bot.on('ready', () =>{
 console.log('This bot is online!' + version);
})

bot.on('message', message => {

 let args = message.content.substring(PREFIX.length).split(" ");

 switch(args[0]){
 case 'play':

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

 server.dispatcher = connection.play(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.voice.channel){
 message.channel.send("You must be in a Voice Channel to play the bot!")
 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.voice) message.member.voice.channel.join().then(function(connection){
 play(connection, message);
 })

 break;
 }



 });


 bot.login(token);




Whenever I try to play a song this error happens :





(node:5180) UnhandledPromiseRejectionWarning : Error : FFmpeg/avconv not
 found !
 at Function.getInfo (C :\Users\picar\Desktop\DiscordMusicBot\node_modules\prism-media\src\core\FFmpeg.js:130:11)
 at Function.create (C :\Users\picar\Desktop\DiscordMusicBot\node_modules\prism-media\src\core\FFmpeg.js:143:38)
 at new FFmpeg (C :\Users\picar\Desktop\DiscordMusicBot\node_modules\prism-media\src\core\FFmpeg.js:44:27)
 at AudioPlayer.playUnknown (C :\Users\picar\Desktop\DiscordMusicBot\node_modules\discord.js\src\client\voice\player\BasePlayer.js:47:20)
 at VoiceConnection.play (C :\Users\picar\Desktop\DiscordMusicBot\node_modules\discord.js\src\client\voice\util\PlayInterface.js:71:28)
 at play (C :\Users\picar\Desktop\DiscordMusicBot\index.js:29:48)
 at C :\Users\picar\Desktop\DiscordMusicBot\index.js:66:17
 at processTicksAndRejections (internal/process/task_queues.js:97:5)
 (node:5180) UnhandledPromiseRejectionWarning : Unhandled promise rejection. This error originated either by throwing inside of an async
 function without a catch block, or by rejecting a promise which was
 not handled with .catch(). To terminate the node process on unhandled
 promise rejection, use the CLI flag
--unhandled-rejections=strict

 (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode).
 (rejection id : 1)
 (node:5180) [DEP0018] DeprecationWarning : Unhandled promise rejections are deprecated. In the future, promise rejections that are
 not handled will terminate the Node.js process with a non-zero exit
 code




I'm getting very frustrated as the tutorial I'm watching is using a different version of everything !!! Please help.