Add Server Implements for Submanager
All checks were successful
Subsonics - Pipeline/pipeline/head This commit looks good
All checks were successful
Subsonics - Pipeline/pipeline/head This commit looks good
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -32,6 +33,7 @@ module.exports = {
|
||||
|
||||
async function makeAction() {
|
||||
|
||||
|
||||
let embed = new EmbedBuilder()
|
||||
.setColor(0xe033ff)
|
||||
.setTitle('Liste de lecture')
|
||||
@ -40,6 +42,7 @@ module.exports = {
|
||||
|
||||
let player = client.manager.players.get(interaction.guild.id)
|
||||
|
||||
|
||||
|
||||
if(!player) {
|
||||
|
||||
@ -53,8 +56,7 @@ module.exports = {
|
||||
interaction.reply({embeds: [embed]})
|
||||
} else {
|
||||
|
||||
console.log("------------------------QUEUE.JS---------------------")
|
||||
console.log(client.manager.players.get(interaction.guild.id).queue)
|
||||
|
||||
let queue = client.manager.players.get(interaction.guild.id).queue;
|
||||
|
||||
|
||||
@ -85,6 +87,9 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
process.emit("discordDoing")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -8,7 +9,7 @@ module.exports = {
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
console.log(interaction.member._roles)
|
||||
|
||||
|
||||
if(interaction.member._roles.includes("397725956598530050") == true | interaction.member.user.id == "486943594893017119") {
|
||||
if(client.dictator == true) {
|
||||
@ -52,7 +53,7 @@ module.exports = {
|
||||
|
||||
|
||||
|
||||
|
||||
process.emit("discordDoing")
|
||||
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -8,7 +9,7 @@ module.exports = {
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
|
||||
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(0x03ff2d)
|
||||
|
@ -1,5 +1,6 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const { Player } = require("erela.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -56,6 +57,8 @@ module.exports = {
|
||||
|
||||
interaction.reply("**Aucune musique n'est actuellement jouée !**")
|
||||
}
|
||||
|
||||
process.emit("discordDoing")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -31,7 +32,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
async function makeAction() {
|
||||
|
||||
|
||||
if(!interaction.member.voice.channel) return interaction.reply({content:"Vous devez rejoindre un salon vocal !", ephemeral: true})
|
||||
|
||||
let player = client.manager.players.get(interaction.guild.id)
|
||||
@ -75,6 +76,10 @@ module.exports = {
|
||||
interaction.reply("**Aucune musique n'est actuellement jouée !**")
|
||||
|
||||
}
|
||||
|
||||
|
||||
process.emit("discordDoing")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -8,6 +9,8 @@ module.exports = {
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
|
||||
|
||||
if(client.dictator == true ) {
|
||||
|
||||
if((interaction.member._roles.includes("397725956598530050") == true | interaction.member.user.id == "486943594893017119")) {
|
||||
@ -32,6 +35,7 @@ module.exports = {
|
||||
|
||||
async function makeAction() {
|
||||
|
||||
|
||||
if(!interaction.member.voice.channel) return interaction.reply({content:"Vous devez rejoindre un salon vocal !", ephemeral: true})
|
||||
|
||||
let player = client.manager.players.get(interaction.guild.id)
|
||||
@ -59,6 +63,9 @@ module.exports = {
|
||||
|
||||
interaction.reply("**Aucune musique n'est actuellement jouée !**")
|
||||
}
|
||||
|
||||
|
||||
process.emit("discordDoing")
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -8,7 +9,7 @@ module.exports = {
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
|
||||
process.emit("discordDoing")
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(0xb0f542)
|
||||
.setTitle('Résultat du ping')
|
||||
|
@ -1,5 +1,6 @@
|
||||
const { EmbedBuilder } = require("@discordjs/builders");
|
||||
const { SlashCommandBuilder, Embed } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -9,7 +10,7 @@ module.exports = {
|
||||
.addStringOption(option => option.setName("nom_ou_lien").setDescription("Le nom de la musique recherchée !").setRequired(true)),
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
|
||||
if(client.dictator == true ) {
|
||||
|
||||
if((interaction.member._roles.includes("397725956598530050") == true | interaction.member.user.id == "486943594893017119")) {
|
||||
@ -34,9 +35,11 @@ module.exports = {
|
||||
|
||||
async function makeAction() {
|
||||
|
||||
|
||||
|
||||
const song_name = interaction.options.getString("nom_ou_lien")
|
||||
|
||||
if(!interaction.member.voice.channel) return interaction.reply({content:"Vous devez rejoindre un salon vocal !", ephemeral: true})
|
||||
if(!interaction.member.voice.channel) return interaction.reply({content:"Vous devez rejoindre un salon vocal !", ephemeral: true})
|
||||
|
||||
let player = client.manager.players.get(interaction.guild.id)
|
||||
|
||||
@ -71,8 +74,8 @@ module.exports = {
|
||||
|
||||
interaction.reply({embeds: [embed]})
|
||||
} catch(error) {
|
||||
|
||||
console.log(error)
|
||||
log.bot.error("Error processing /play")
|
||||
log.bot.error(error);
|
||||
}
|
||||
|
||||
|
||||
@ -92,20 +95,20 @@ module.exports = {
|
||||
.setTimestamp();
|
||||
|
||||
client.manager.players.get(interaction.guild.id).queue.add(songs.tracks[0])
|
||||
console.log("------------------------PLAY.JS---------------------")
|
||||
console.log(player.queue)
|
||||
console.log("--------------------------------------------")
|
||||
|
||||
try {
|
||||
|
||||
interaction.reply({embeds: [embed]})
|
||||
interaction.reply({embeds: [embed]})
|
||||
} catch(error) {
|
||||
|
||||
console.log(error)
|
||||
log.bot.error("Error processing /play")
|
||||
log.bot.error(error);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
process.emit("discordDoing")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
const { EmbedBuilder } = require("@discordjs/builders");
|
||||
const { SlashCommandBuilder, Embed } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
|
||||
module.exports = {
|
||||
@ -35,6 +36,8 @@ module.exports = {
|
||||
|
||||
async function makeAction() {
|
||||
|
||||
process.emit("discordDoing")
|
||||
|
||||
const song_name = interaction.options.getString("lien")
|
||||
|
||||
if(!interaction.member.voice.channel) return interaction.reply({content:"Vous devez rejoindre un salon vocal !", ephemeral: true})
|
||||
@ -62,12 +65,19 @@ module.exports = {
|
||||
try {
|
||||
|
||||
var playlist = await ytfps(song_name)
|
||||
var author = "Artiste inconnu !"
|
||||
|
||||
if(typeof playlist.author != "undefined" ) {
|
||||
|
||||
author == playlist.author.name
|
||||
}
|
||||
|
||||
|
||||
const embed = await new EmbedBuilder()
|
||||
.setColor(0x15e6ed)
|
||||
.setTitle('**Lecture de la playlist : **' + playlist.title)
|
||||
.setDescription('**Demandé par **' + interaction.member.user.username)
|
||||
.addFields({name: "Auteur", value: playlist.author.name},
|
||||
.addFields({name: "Auteur", value: author},
|
||||
{name: "URL", value:playlist.url},
|
||||
{name: "Nombre de videos", value:playlist.video_count + " vidéos"})
|
||||
.setThumbnail(playlist.thumbnail_url)
|
||||
@ -78,18 +88,32 @@ module.exports = {
|
||||
await interaction.reply({embeds: [embed]})
|
||||
} catch(error) {
|
||||
|
||||
console.log(error)
|
||||
log.bot.error(error);
|
||||
}
|
||||
|
||||
addList(playlist, player)
|
||||
|
||||
for(var song of playlist.videos) {
|
||||
async function addList(Pplaylist, Pplayer) {
|
||||
|
||||
for(var song of Pplaylist.videos) {
|
||||
|
||||
const song_finded = await client.manager.search(song.url)
|
||||
await client.manager.players.get(interaction.guild.id).queue.add(song_finded.tracks[0])
|
||||
|
||||
const song_finded = await client.manager.search(song.url)
|
||||
await client.manager.players.get(interaction.guild.id).queue.add(song_finded.tracks[0])
|
||||
|
||||
}
|
||||
|
||||
if(Pplayer.playing == false) {
|
||||
|
||||
await Pplayer.play()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} catch(err) {
|
||||
|
||||
|
||||
await process.emit("discordDoing")
|
||||
|
||||
} catch(error) {
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(0xff0303)
|
||||
@ -100,27 +124,21 @@ module.exports = {
|
||||
embed.addFields(song_show)
|
||||
interaction.reply({embeds: [embed]})
|
||||
|
||||
console.log(err)
|
||||
log.bot.error(error);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
if(playlist != null) {
|
||||
|
||||
|
||||
if(!player.playing) {
|
||||
|
||||
|
||||
player.play()
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
process.emit("discordDoing")
|
||||
|
||||
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -36,6 +37,8 @@ module.exports = {
|
||||
}
|
||||
|
||||
async function makeAction() {
|
||||
|
||||
|
||||
|
||||
if(!interaction.member.voice.channel) return interaction.reply({content:"Vous devez rejoindre un salon vocal !", ephemeral: true})
|
||||
|
||||
@ -62,8 +65,6 @@ module.exports = {
|
||||
interaction.reply({embeds: [embed]})
|
||||
} else {
|
||||
|
||||
console.log("------------------------QUEUE.JS---------------------")
|
||||
console.log(client.manager.players.get(interaction.guild.id).queue)
|
||||
let queue = client.manager.players.get(interaction.guild.id).queue;
|
||||
|
||||
|
||||
@ -75,12 +76,15 @@ module.exports = {
|
||||
interaction.reply({embeds: [embed]})
|
||||
} else {
|
||||
|
||||
|
||||
for(song of queue) {
|
||||
|
||||
const song_show = {name: queue.indexOf(song) + " - " + song.title, value: song.author}
|
||||
var fieldmax = 0
|
||||
for(var song of queue) {
|
||||
fieldmax += 1
|
||||
if(fieldmax <= 25) {
|
||||
const song_show = {name: queue.indexOf(song) + " - " + song.title, value: song.author}
|
||||
|
||||
embed.addFields(song_show)
|
||||
embed.addFields(song_show)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
await interaction.reply({embeds: [embed]})
|
||||
@ -110,8 +114,6 @@ module.exports = {
|
||||
interaction.reply({embeds: [embed]})
|
||||
} else {
|
||||
|
||||
console.log("------------------------QUEUE.JS---------------------")
|
||||
console.log(client.manager.players.get(interaction.guild.id).queue)
|
||||
let queue = client.manager.players.get(interaction.guild.id).queue;
|
||||
|
||||
|
||||
@ -129,8 +131,7 @@ module.exports = {
|
||||
|
||||
const number = interaction.options.getInteger("number")
|
||||
|
||||
console.log(number)
|
||||
|
||||
|
||||
if(number != null) {
|
||||
try {
|
||||
queue.splice(number, 1)
|
||||
@ -179,6 +180,8 @@ module.exports = {
|
||||
|
||||
await interaction.reply("**La commande a été mal éxécutée !**")
|
||||
}
|
||||
|
||||
process.emit("discordDoing")
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
const { Manager } = require("erela.js")
|
||||
|
||||
|
||||
@ -10,7 +12,7 @@ module.exports = {
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
console.log(interaction.member._roles)
|
||||
|
||||
|
||||
if(interaction.member._roles.includes("397725956598530050") == true | interaction.member._roles.includes("397724656548970508") == true| interaction.member._roles.includes("397725128198455299") == true| interaction.member._roles.includes("397725552968204288") == true | interaction.member.user.id == "486943594893017119") {
|
||||
const embed = new EmbedBuilder()
|
||||
@ -56,7 +58,7 @@ module.exports = {
|
||||
|
||||
|
||||
}
|
||||
|
||||
process.emit("discordDoing")
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -8,6 +9,8 @@ module.exports = {
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
|
||||
|
||||
if(client.dictator == true ) {
|
||||
|
||||
if((interaction.member._roles.includes("397725956598530050") == true | interaction.member.user.id == "486943594893017119")) {
|
||||
@ -60,6 +63,8 @@ module.exports = {
|
||||
|
||||
interaction.reply("**Aucune musique n'est actuellement jouée !**")
|
||||
}
|
||||
|
||||
process.emit("discordDoing")
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -9,6 +10,8 @@ module.exports = {
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
|
||||
|
||||
if(client.dictator == true ) {
|
||||
|
||||
if((interaction.member._roles.includes("397725956598530050") == true | interaction.member.user.id == "486943594893017119")) {
|
||||
@ -58,7 +61,7 @@ module.exports = {
|
||||
|
||||
} catch (error) {
|
||||
|
||||
console.log(error)
|
||||
log.bot.error(error);
|
||||
interaction.reply("**Aucune musique n'est actuellement jouée !**")
|
||||
}
|
||||
|
||||
@ -71,6 +74,8 @@ module.exports = {
|
||||
interaction.reply("**Aucune musique n'est actuellement jouée !**")
|
||||
|
||||
}
|
||||
|
||||
process.emit("discordDoing")
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -8,6 +9,8 @@ module.exports = {
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
|
||||
|
||||
if(client.dictator == true ) {
|
||||
|
||||
if((interaction.member._roles.includes("397725956598530050") == true | interaction.member.user.id == "486943594893017119")) {
|
||||
@ -61,6 +64,8 @@ module.exports = {
|
||||
interaction.reply("**Aucune musique n'est actuellement jouée !**")
|
||||
|
||||
}
|
||||
|
||||
process.emit("discordDoing")
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -7,6 +8,7 @@ module.exports = {
|
||||
.setDescription("Permet de passer à la musique suivante !"),
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
|
||||
if(client.dictator == true ) {
|
||||
|
||||
@ -53,8 +55,7 @@ module.exports = {
|
||||
interaction.reply({embeds: [embed]})
|
||||
} else {
|
||||
|
||||
console.log("------------------------QUEUE.JS---------------------")
|
||||
console.log(client.manager.players.get(interaction.guild.id).queue)
|
||||
|
||||
let queue = client.manager.players.get(interaction.guild.id).queue;
|
||||
|
||||
|
||||
@ -83,7 +84,7 @@ module.exports = {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
process.emit("discordDoing")
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -8,6 +9,8 @@ module.exports = {
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
|
||||
|
||||
if(!interaction.member.voice.channel) return interaction.reply({content:"Vous devez rejoindre un salon vocal !", ephemeral: true})
|
||||
|
||||
let player = client.manager.players.get(interaction.guild.id)
|
||||
|
@ -1,5 +1,6 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const packageJson = require('../../package.json');
|
||||
const log = require("../sublog")
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -9,7 +10,8 @@ module.exports = {
|
||||
|
||||
async execute(client, interaction) {
|
||||
|
||||
|
||||
process.emit("discordDoing")
|
||||
|
||||
const uptime = process.uptime();
|
||||
const minutes = Math.floor(uptime / 60);
|
||||
const seconds = Math.floor(uptime % 60);
|
||||
|
Reference in New Issue
Block a user