mirror of
https://github.com/musix-org/musix-oss
synced 2025-07-03 16:24:28 +00:00
Chore update 3.9
This commit is contained in:
@ -6,7 +6,7 @@ module.exports = {
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
permission: "MANAGE_MESSAGES",
|
||||
category: "music",
|
||||
category: "audio modifiers",
|
||||
execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (!args[1] && queue)
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: 'list all commands and how many times they\'ve been used',
|
||||
onlyDev: true,
|
||||
permission: 'dev',
|
||||
category: 'info',
|
||||
category: 'util',
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const cmduses = [];
|
||||
client.commands.forEach((value, key) => {
|
||||
|
@ -1,13 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'end',
|
||||
alias: ["none"],
|
||||
usage: '',
|
||||
description: 'just end it',
|
||||
onlyDev: true,
|
||||
permission: 'dev',
|
||||
category: 'util',
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
client.queue.delete(msg.guild.id);
|
||||
msg.channel.send(client.messages.queueDeleted);
|
||||
}
|
||||
};
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: 'loop the queue.',
|
||||
onlyDev: false,
|
||||
permission: 'MANAGE_MESSAGES',
|
||||
category: 'music',
|
||||
category: 'music control',
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: 'loop the currently playing song.',
|
||||
onlyDev: false,
|
||||
permission: 'MANAGE_MESSAGES',
|
||||
category: 'music',
|
||||
category: 'music control',
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: "Change nigthcore audio modifier on/off",
|
||||
onlyDev: false,
|
||||
permission: "MANAGE_MESSAGES",
|
||||
category: "music",
|
||||
category: "audio modifiers",
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (!args[1] && queue)
|
||||
|
@ -5,10 +5,10 @@ module.exports = {
|
||||
description: "See the currently playing song position and length.",
|
||||
onlyDev: false,
|
||||
permission: "none",
|
||||
category: "music",
|
||||
category: "info",
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (!queue) return msg.channel.send(client.messages.noServerQueue);
|
||||
if (!queue || !queue.songs[0] || !queue.connection || !queue.connection.dispatcher) return msg.channel.send(client.messages.noServerQueue);
|
||||
let songTime = (queue.songs[0].info.lengthSeconds * 1000).toFixed(0);
|
||||
let completed = (
|
||||
queue.connection.dispatcher.streamTime + queue.time
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: 'Pause the currently playing music.',
|
||||
onlyDev: false,
|
||||
permission: 'MANAGE_MESSAGES',
|
||||
category: 'music',
|
||||
category: 'music control',
|
||||
execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -1,5 +1,3 @@
|
||||
const YouTube = require("simple-youtube-api");
|
||||
const SpotifyApi = require("spotify-web-api-node");
|
||||
const ytdl = require("ytdl-core");
|
||||
const ytsr = require("ytsr");
|
||||
|
||||
@ -10,15 +8,8 @@ module.exports = {
|
||||
description: "Play some music.",
|
||||
onlyDev: false,
|
||||
permission: "none",
|
||||
category: "music",
|
||||
category: "play",
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const spotify = new SpotifyApi({
|
||||
id: client.config.spotify_client_id,
|
||||
secret: client.config.spotify_client_secret,
|
||||
});
|
||||
spotify.setAccessToken(client.config.spotify_access_key);
|
||||
|
||||
const youtube = new YouTube(client.config.api_key);
|
||||
const searchString = args.slice(1).join(" ");
|
||||
const url = args[1] ? args[1].replace(/<(.+)>/g, "$1") : "";
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
@ -47,7 +38,7 @@ module.exports = {
|
||||
} else if (url.match(/^https?:\/\/(open.spotify.com|spotify.com)(.*)$/)) {
|
||||
if (url.includes("playlist")) {
|
||||
const playlistId = url.split("/playlist/")[1].split("?")[0];
|
||||
spotify.getPlaylist(playlistId).then(
|
||||
client.spotify.getPlaylist(playlistId).then(
|
||||
async function (data) {
|
||||
console.log(data.body)
|
||||
searchPlaylist(data, client, msg, voiceChannel);
|
||||
@ -59,7 +50,7 @@ module.exports = {
|
||||
);
|
||||
} else if (url.includes("album")) {
|
||||
const albumId = url.split("/album/")[1].split("?")[0];
|
||||
spotify.getAlbumTracks(albumId).then(
|
||||
client.spotify.getAlbumTracks(albumId).then(
|
||||
async function (data) {
|
||||
searchAlbum(data, client, msg, voiceChannel);
|
||||
},
|
||||
@ -82,17 +73,17 @@ module.exports = {
|
||||
url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)
|
||||
) {
|
||||
const lmsg = await msg.channel.send(client.messages.loadingSongs);
|
||||
const playlist = await youtube.getPlaylist(url).catch((err) => {
|
||||
const playlist = await client.youtube.getPlaylist(url).catch((err) => {
|
||||
console.log("err1");
|
||||
});
|
||||
const videos = await playlist.getVideos().catch((err) => {
|
||||
console.log("err2");
|
||||
});
|
||||
for (const video of Object.values(videos)) {
|
||||
const video2 = await youtube.getVideoByID(video.id).catch((err) => {
|
||||
const video2 = await client.youtube.getVideoByID(video.id).catch((err) => {
|
||||
console.log("err3");
|
||||
});
|
||||
spotify.searchTracks(`track:${video2.name}`).then(
|
||||
client.spotify.searchTracks(`track:${video2.name}`).then(
|
||||
function (data) {
|
||||
client.funcs.handleVideo(
|
||||
video2.url,
|
||||
@ -125,7 +116,7 @@ module.exports = {
|
||||
const videoResults = res.items.filter(
|
||||
(item) => item.type === "video"
|
||||
);
|
||||
spotify.searchTracks(`track:${searchString}`).then(
|
||||
client.spotify.searchTracks(`track:${searchString}`).then(
|
||||
function (data) {
|
||||
client.funcs.handleVideo(
|
||||
videoResults[0].link,
|
||||
@ -138,7 +129,7 @@ module.exports = {
|
||||
);
|
||||
},
|
||||
function (err) {
|
||||
console.log("Something went wrong!", err);
|
||||
console.log(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: 'Play the previous song.',
|
||||
onlyDev: false,
|
||||
permission: 'MANAGE_MESSAGES',
|
||||
category: 'music',
|
||||
category: 'music control',
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id)
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: 'See the queue.',
|
||||
onlyDev: false,
|
||||
permission: 'none',
|
||||
category: 'music',
|
||||
category: 'info',
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (!queue) return msg.channel.send(client.messages.noServerQueue);
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: "Remove a song from the queue",
|
||||
onlyDev: false,
|
||||
permission: "MANAGE_MESSAGES",
|
||||
category: "music",
|
||||
category: "music control",
|
||||
execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: 'Replay the currently playing song.',
|
||||
onlyDev: false,
|
||||
permission: 'MANAGE_MESSAGES',
|
||||
category: 'music',
|
||||
category: 'play',
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: 'Resume the paused music.',
|
||||
onlyDev: false,
|
||||
permission: 'MANAGE_MESSAGES',
|
||||
category: 'music',
|
||||
category: 'music control',
|
||||
execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -1,5 +1,4 @@
|
||||
const ytsr = require('ytsr');
|
||||
const SpotifyApi = require("spotify-web-api-node");
|
||||
const he = require('he');
|
||||
|
||||
module.exports = {
|
||||
@ -9,14 +8,8 @@ module.exports = {
|
||||
description: 'Search the top 10 queryes and choose one.',
|
||||
onlyDev: false,
|
||||
permission: 'none',
|
||||
category: 'music',
|
||||
category: 'play',
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const spotify = new SpotifyApi({
|
||||
id: client.config.spotify_client_id,
|
||||
secret: client.config.spotify_client_secret,
|
||||
});
|
||||
spotify.setAccessToken(client.config.spotify_access_key);
|
||||
|
||||
const searchString = args.slice(1).join(" ");
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
const voiceChannel = msg.member.voice.channel;
|
||||
@ -54,7 +47,7 @@ module.exports = {
|
||||
return msg.channel.send(client.messages.cancellingVideoSelection);
|
||||
}
|
||||
const videoIndex = parseInt(response.first().content) - 1;
|
||||
spotify.searchTracks(`track:${videos[videoIndex].title}`)
|
||||
client.spotify.searchTracks(`track:${videos[videoIndex].title}`)
|
||||
.then(function (data) {
|
||||
client.funcs.handleVideo(
|
||||
videoResults[0].link,
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: "Seek to a specific point in the currently playing song.",
|
||||
onlyDev: false,
|
||||
permission: "MANAGE_MESSAGES",
|
||||
category: "music",
|
||||
category: "music control",
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: 'Shuffle the queue.',
|
||||
onlyDev: false,
|
||||
permission: 'MANAGE_MESSAGES',
|
||||
category: 'music',
|
||||
category: 'music control',
|
||||
execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: "Skip the currently playing song.",
|
||||
onlyDev: false,
|
||||
permission: "MANAGE_MESSAGES",
|
||||
category: "music",
|
||||
category: "music control",
|
||||
execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
const permissions = msg.channel.permissionsFor(msg.author);
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: "Skip to a point in the queue",
|
||||
onlyDev: false,
|
||||
permission: "MANAGE_MESSAGES",
|
||||
category: "music",
|
||||
category: "music control",
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
description: "",
|
||||
onlyDev: true,
|
||||
permission: "dev",
|
||||
category: "music",
|
||||
category: "play",
|
||||
async execute(msg, args, client, Discord, prefix, command) {
|
||||
if (!args[1]) return msg.channel.send(client.messages.noQuery);
|
||||
const SoundCloud = require("soundcloud-api-client");
|
||||
|
@ -5,7 +5,7 @@ module.exports = {
|
||||
usage: '',
|
||||
onlyDev: false,
|
||||
permission: 'MANAGE_CHANNELS',
|
||||
category: 'music',
|
||||
category: 'music control',
|
||||
execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (client.funcs.check(client, msg, command)) {
|
||||
|
@ -6,7 +6,7 @@ module.exports = {
|
||||
cooldown: 5,
|
||||
onlyDev: false,
|
||||
permission: 'MANAGE_MESSAGES',
|
||||
category: 'music',
|
||||
category: 'music control',
|
||||
execute(msg, args, client, Discord, command) {
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
if (!args[1] && queue) return msg.channel.send(`${client.messages.currentVolume}**${queue.volume}**`);
|
||||
|
Reference in New Issue
Block a user