mirror of
				https://github.com/musix-org/musix-oss
				synced 2025-11-04 00:29:32 +00:00 
			
		
		
		
	Update 3.3
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "musix",
 | 
					  "name": "musix",
 | 
				
			||||||
  "version": "3.2.2",
 | 
					  "version": "3.3.0",
 | 
				
			||||||
  "description": "V3 for Musix the discord music bot",
 | 
					  "description": "V3 for Musix the discord music bot",
 | 
				
			||||||
  "main": "./index.js",
 | 
					  "main": "./index.js",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										18
									
								
								src/commands/previous.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/commands/previous.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					module.exports = {
 | 
				
			||||||
 | 
					    name: 'previous',
 | 
				
			||||||
 | 
					    alias: 'prev',
 | 
				
			||||||
 | 
					    usage: '',
 | 
				
			||||||
 | 
					    description: 'Play the previous song.',
 | 
				
			||||||
 | 
					    onlyDev: false,
 | 
				
			||||||
 | 
					    permission: 'MANAGE_MESSAGES',
 | 
				
			||||||
 | 
					    category: 'music',
 | 
				
			||||||
 | 
					    async execute(msg, args, client, Discord, command) {
 | 
				
			||||||
 | 
					        const queue = client.queue.get(msg.guild.id)
 | 
				
			||||||
 | 
					        if (client.funcs.check(client, msg, command)) {
 | 
				
			||||||
 | 
					            if (queue.prevSongs.length < 1) return msg.channel.send(client.messages.noPreviousSongs);
 | 
				
			||||||
 | 
					            queue.endReason = "previous";
 | 
				
			||||||
 | 
					            queue.connection.dispatcher.end()
 | 
				
			||||||
 | 
					            msg.channel.send(client.messages.previousSong)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
							
								
								
									
										16
									
								
								src/commands/replay.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/commands/replay.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
				
			|||||||
 | 
					module.exports = {
 | 
				
			||||||
 | 
					    name: 'replay',
 | 
				
			||||||
 | 
					    alias: 'none',
 | 
				
			||||||
 | 
					    usage: '',
 | 
				
			||||||
 | 
					    description: 'Replay the currently playing song.',
 | 
				
			||||||
 | 
					    onlyDev: false,
 | 
				
			||||||
 | 
					    permission: 'MANAGE_MESSAGES',
 | 
				
			||||||
 | 
					    category: 'music',
 | 
				
			||||||
 | 
					    async execute(msg, args, client, Discord, command) {
 | 
				
			||||||
 | 
					        const queue = client.queue.get(msg.guild.id);
 | 
				
			||||||
 | 
					        if (client.funcs.check(client, msg, command)) {
 | 
				
			||||||
 | 
					            queue.endReason = "replay";
 | 
				
			||||||
 | 
					            queue.connection.dispatcher.end()
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
@@ -20,7 +20,7 @@ module.exports = {
 | 
				
			|||||||
        return msg.channel.send(client.messages.noSongs);
 | 
					        return msg.channel.send(client.messages.noSongs);
 | 
				
			||||||
      if (point < 0) return msg.channel.send(client.messages.cantSkipToCurrent);
 | 
					      if (point < 0) return msg.channel.send(client.messages.cantSkipToCurrent);
 | 
				
			||||||
      for (let i = 0; i < point; i++) {
 | 
					      for (let i = 0; i < point; i++) {
 | 
				
			||||||
        queue.songs.shift();
 | 
					        queue.prevSongs.push(queue.songs.shift());
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      queue.endReason = "skipto";
 | 
					      queue.endReason = "skipto";
 | 
				
			||||||
      queue.time = 0;
 | 
					      queue.time = 0;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,7 +13,10 @@ module.exports = async function (client, reason, guild) {
 | 
				
			|||||||
    queue.time = 0;
 | 
					    queue.time = 0;
 | 
				
			||||||
    queue.votes = 0;
 | 
					    queue.votes = 0;
 | 
				
			||||||
    queue.voters = [];
 | 
					    queue.voters = [];
 | 
				
			||||||
    queue.songs.shift();
 | 
					    if (reason !== "replay") {
 | 
				
			||||||
 | 
					      if (reason === "previous") queue.songs.unshift(queue.prevSongs.pop())
 | 
				
			||||||
 | 
					      if (reason !== "previous") queue.prevSongs.push(queue.songs.shift());
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  client.funcs.play(guild, queue.songs[0], client, 0, true);
 | 
					  client.funcs.play(guild, queue.songs[0], client, 0, true);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
@@ -21,7 +21,7 @@ module.exports = {
 | 
				
			|||||||
  embedColor: "#b50002",
 | 
					  embedColor: "#b50002",
 | 
				
			||||||
  invite: "https://discordapp.com/oauth2/authorize?client_id=607266889537945605&permissions=3427328&scope=bot",
 | 
					  invite: "https://discordapp.com/oauth2/authorize?client_id=607266889537945605&permissions=3427328&scope=bot",
 | 
				
			||||||
  supportServer: "https://discord.gg/rvHuJtB",
 | 
					  supportServer: "https://discord.gg/rvHuJtB",
 | 
				
			||||||
  devMode: false,
 | 
					  devMode: true,
 | 
				
			||||||
  api: false,
 | 
					  api: false,
 | 
				
			||||||
  saveDB: true,
 | 
					  saveDB: true,
 | 
				
			||||||
  respawn: true,
 | 
					  respawn: true,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,7 @@ module.exports = {
 | 
				
			|||||||
  megaPhone: "📣 ",
 | 
					  megaPhone: "📣 ",
 | 
				
			||||||
  notes: "<a:aNotes:674602408105476106>",
 | 
					  notes: "<a:aNotes:674602408105476106>",
 | 
				
			||||||
  pause: "<:pause:674685548610322462> ",
 | 
					  pause: "<:pause:674685548610322462> ",
 | 
				
			||||||
 | 
					  previous: "<:reverse:705012312142119012> ",
 | 
				
			||||||
  redx: "<:redx:674263474704220182> ",
 | 
					  redx: "<:redx:674263474704220182> ",
 | 
				
			||||||
  repeat: "<:repeat1:674685561377914892> ",
 | 
					  repeat: "<:repeat1:674685561377914892> ",
 | 
				
			||||||
  repeatSong: "<:repeatsong:674685573419761716> ",
 | 
					  repeatSong: "<:repeatsong:674685573419761716> ",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -92,6 +92,7 @@ module.exports = {
 | 
				
			|||||||
    "I cannot speak in your voice channel, make sure I have the proper permissions!",
 | 
					    "I cannot speak in your voice channel, make sure I have the proper permissions!",
 | 
				
			||||||
  noPermsUseExternalEmojis: emojis.redx +
 | 
					  noPermsUseExternalEmojis: emojis.redx +
 | 
				
			||||||
    "I cannot use external emojis, make sure I have the proper permissions!",
 | 
					    "I cannot use external emojis, make sure I have the proper permissions!",
 | 
				
			||||||
 | 
					  noPreviousSongs: emojis.redx + "No previous songs!",
 | 
				
			||||||
  noQuery: emojis.redx + "you need to use a link or search for a song!",
 | 
					  noQuery: emojis.redx + "you need to use a link or search for a song!",
 | 
				
			||||||
  noResults: emojis.redx + "I could not obtain any search results!",
 | 
					  noResults: emojis.redx + "I could not obtain any search results!",
 | 
				
			||||||
  noResultsLyrics: emojis.redx + "I could not obtain any results!",
 | 
					  noResultsLyrics: emojis.redx + "I could not obtain any results!",
 | 
				
			||||||
@@ -124,6 +125,7 @@ module.exports = {
 | 
				
			|||||||
  prefixMaxLength: "The prefix must be shorter or equal to 5 letters!",
 | 
					  prefixMaxLength: "The prefix must be shorter or equal to 5 letters!",
 | 
				
			||||||
  prefixSet: emojis.green_check_mark + "New prefix set to:",
 | 
					  prefixSet: emojis.green_check_mark + "New prefix set to:",
 | 
				
			||||||
  premiumState: "Premium status: ",
 | 
					  premiumState: "Premium status: ",
 | 
				
			||||||
 | 
					  previousSong: emojis.previous + "Previous",
 | 
				
			||||||
  provideANumber: "Please provide a number ranging from 1-10 to select one of the search results.",
 | 
					  provideANumber: "Please provide a number ranging from 1-10 to select one of the search results.",
 | 
				
			||||||
  provideASong: emojis.redx + "Please provide a song position in queue for me to remove!",
 | 
					  provideASong: emojis.redx + "Please provide a song position in queue for me to remove!",
 | 
				
			||||||
  queueDeleted: "Queue deleted!",
 | 
					  queueDeleted: "Queue deleted!",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,7 @@ module.exports = async function (
 | 
				
			|||||||
    voiceChannel: voiceChannel,
 | 
					    voiceChannel: voiceChannel,
 | 
				
			||||||
    connection: null,
 | 
					    connection: null,
 | 
				
			||||||
    songs: [],
 | 
					    songs: [],
 | 
				
			||||||
 | 
					    prevSongs: [],
 | 
				
			||||||
    volume: client.global.db.guilds[msg.guild.id].defaultVolume,
 | 
					    volume: client.global.db.guilds[msg.guild.id].defaultVolume,
 | 
				
			||||||
    bass: client.global.db.guilds[msg.guild.id].bass,
 | 
					    bass: client.global.db.guilds[msg.guild.id].bass,
 | 
				
			||||||
    nigthCore: false,
 | 
					    nigthCore: false,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,7 @@
 | 
				
			|||||||
module.exports = async function (guild, song, client, seek, play) {
 | 
					module.exports = async function (guild, song, client, seek, play) {
 | 
				
			||||||
  const { Readable: ReadableStream } = require("stream");
 | 
					  const {
 | 
				
			||||||
 | 
					    Readable: ReadableStream
 | 
				
			||||||
 | 
					  } = require("stream");
 | 
				
			||||||
  const Discord = require("discord.js");
 | 
					  const Discord = require("discord.js");
 | 
				
			||||||
  const ytdl = require("ytdl-core");
 | 
					  const ytdl = require("ytdl-core");
 | 
				
			||||||
  const streamConfig = require("../config/streamConfig.js");
 | 
					  const streamConfig = require("../config/streamConfig.js");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user