mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-16 18:56:00 +00:00
Update 3.0.3
All messages reworked.
This commit is contained in:
@ -19,6 +19,7 @@ module.exports = class extends Client {
|
||||
this.funcs = {};
|
||||
this.dispatcher = {};
|
||||
this.config = require('./config/config.js');
|
||||
this.messages = require('./config/messages.js');
|
||||
this.dispatcher.finish = require('../events/dispatcher/finish.js');
|
||||
|
||||
fs.readdirSync(path.join(__dirname, 'funcs')).forEach(filename => {
|
||||
|
92
struct/config/messages.js
Normal file
92
struct/config/messages.js
Normal file
@ -0,0 +1,92 @@
|
||||
/*
|
||||
THIS FILE CONTAINS ALL MESSAGES THAT MUSIX SENDS!
|
||||
THIS IS MUSIX BRANDING AND YOU'RE NOT PERMITTED TO COPY ALL THE VISUALS FROM MUSIX!
|
||||
IF YOU CLONED THIS REPOSITORY PLEASE MODIFY THESE MESSAGES!
|
||||
*/
|
||||
module.exports = {
|
||||
restart: "restarted!",
|
||||
reloaded: "All files reloaded!",
|
||||
validNumber: "<:redx:674263474704220182> I\'m sorry, But you need to enter a valid __number__.",
|
||||
boolean: "<:redx:674263474704220182> Please define a boolean! (true/false)",
|
||||
correctUsage: "<:redx:674263474704220182> correct usage: ",
|
||||
wrongVoiceChannel: "<:redx:674263474704220182> I'm sorry but you need to be in the same voice channel as Musix to use this command!",
|
||||
noQuery: "<:redx:674263474704220182> You need to use a link or search for a song!",
|
||||
noResults: "<:redx:674263474704220182> I could not obtain any search results!",
|
||||
noServerQueue: "<:redx:674263474704220182> There is nothing playing!",
|
||||
noVoiceChannel: "<:redx:674263474704220182> I\'m sorry but you need to be in a voice channel to play music!",
|
||||
noDj: "<:redx:674263474704220182> You need the `DJ` role to use this command!",
|
||||
noPerms: `<:redx:674263474704220182> You need the %PERMS% permission to use this command!`,
|
||||
noPermsManageSettings: "<:redx:674263474704220182> You need the `MANAGE_SERVER` permission to change the settings!",
|
||||
noPermsEmbed: "<:redx:674263474704220182> I cannot send embeds (Embed links), make sure I have the proper permissions!",
|
||||
noPermsUseExternalEmojis: "<:redx:674263474704220182> I cannot use external emojis, make sure I have the proper permissions!",
|
||||
noPermsConnect: "<:redx:674263474704220182> I cannot connect to your voice channel, make sure I have the proper permissions!",
|
||||
noPermsSpeak: "<:redx:674263474704220182> I cannot speak in your voice channel, make sure I have the proper permissions!",
|
||||
noPermsManageRoles: "<:redx:674263474704220182> I cannot create roles (Manage roles), make sure I have the proper permissions! I will need this permission to create a `DJ` role since i did not find one!",
|
||||
notAllowed: "<:redx:674263474704220182> You are not allowed to do that!",
|
||||
devMode: "<:redx:674263474704220182> Dev mode has been turned on! Commands are only available to developer(s)!",
|
||||
error: "<:redx:674263474704220182> An error occured!",
|
||||
errorExe: "<:redx:674263474704220182> there was an error trying to execute that command! Please contact support with the \`bug\` command!",
|
||||
errorExeOpt: "<:redx:674263474704220182> there was an error trying to execute that option! Please contact support with the \`bug\` command!",
|
||||
errorConnecting: "Error with connecting to voice channel: ",
|
||||
errorDispatcher: "<:redx:674263474704220182> An error has occured while playing music! The queue has been deleted.",
|
||||
songAdded: "<:green_check_mark:674265384777416705> **%TITLE%** has been added to the queue!",
|
||||
playlistAdded: "<:green_check_mark:674265384777416705> Playlist: **%TITLE%** has been added to the queue!",
|
||||
startPlaying: "<a:aNotes:674602408105476106> Start playing: ",
|
||||
loadingSongs: "<a:loading:674284196700618783> Loading song(s)",
|
||||
prefixHere: "My prefix here is: ",
|
||||
prefixSet: "<:green_check_mark:674265384777416705> New prefix set to:",
|
||||
pinging: "<a:loading:674284196700618783> Pinging...",
|
||||
currentVolume: ":loud_sound: The current volume is: ",
|
||||
currentBass: ":loud_sound: The current bass is: ",
|
||||
maxVolume: "<:redx:674263474704220182> The max volume is `100`!",
|
||||
maxBass: "<:redx:674263474704220182> The max bass is `100`!",
|
||||
positiveVolume: "<:redx:674263474704220182> The volume needs to be a positive number!",
|
||||
positiveBass: "<:redx:674263474704220182> The bass needs to be a positive number!",
|
||||
setVolume: "<:volumehigh:674685637626167307> I set the volume to: ",
|
||||
bassApplied: "<:volumehigh:674685637626167307> The bass level **%BASS%** will be applied when the next song starts playing!",
|
||||
stop: "<:stop:674685626108477519> Stopped the music!",
|
||||
noSongs: "'<:redx:674263474704220182> That song does not exist!",
|
||||
cantSkipToCurrent: "<:redx:674263474704220182> You can\'t skip to the song currently playing!",
|
||||
skipped: "<:skip:674685614221688832> Skipped the song!",
|
||||
alreadyVoted: "<:redx:674263474704220182> You have already voted to skip!",
|
||||
notEnoughVotes: "<:redx:674263474704220182> Not enough votes!",
|
||||
shuffled: "<:shuffle:674685595980791871> Queue suffled!",
|
||||
seekingPointPositive: "<:redx:674263474704220182> The seeking point needs to be a positive number!",
|
||||
seekMax: "<:redx:674263474704220182> The lenght of this song is %LENGTH% seconds! You can't seek further than that!",
|
||||
songSelection: "__Song Selection__",
|
||||
nowPlaying: "__Now playing__",
|
||||
provideANumber: "Please provide a number ranging from 1-10 to select one of the search results.",
|
||||
cancellingVideoSelection: "'<:redx:674263474704220182> Cancelling video selection",
|
||||
notPaused: "<:redx:674263474704220182> The music in not paused!",
|
||||
alreadyPaused: "<:redx:674263474704220182> The music is already paused!",
|
||||
resumed: "<:resume:674685585478254603> Resumed the music!",
|
||||
paused: "<:pause:674685548610322462> Paused the music!",
|
||||
provideASong: "<:redx:674263474704220182> Please provide a song position in queue for me to remove!",
|
||||
queueLength: "<:redx:674263474704220182> There are only %SONGS% amount of songs in the queue!",
|
||||
removed: "🗑️ removed \`%SONG%\` from the queue!",
|
||||
loopingSong: "<:repeatsong:674685573419761716> Looping **%TITLE%** now!",
|
||||
noLoopingSong: "<:repeatsong:674685573419761716> No longer looping the song!",
|
||||
looping: "<:repeat1:674685561377914892> Looping the queue now!",
|
||||
noLooping: "<:repeat1:674685561377914892> No longer looping the queue!",
|
||||
joined: "<:green_check_mark:674265384777416705> Joined",
|
||||
queueDeleted: "Queue deleted!",
|
||||
bug: "Matte#0002\nOr join the support server: https://discord.gg/rvHuJtB",
|
||||
currentDefaultVolume: ":speaker: Current default volume is:",
|
||||
defaultVolumeNumber: "<:redx:674263474704220182> I\'m sorry, But the default volume needs to be a valid __number__.",
|
||||
defaultVolumeMax: "<:redx:674263474704220182> The default volume must be below `100` for quality and safety resons.",
|
||||
defaultVolumeSet: "<:green_check_mark:674265384777416705> Default volume set to:",
|
||||
djRoleFound: "<:green_check_mark:674265384777416705> I found a `DJ` role from this guild! This role is now the DJ role.",
|
||||
djRoleCreated: "<:green_check_mark:674265384777416705> I did not find a role `DJ` so i have created one for you!",
|
||||
djFalse: "<:green_check_mark:674265384777416705> `DJ` now set to `false`",
|
||||
reset: "<:green_check_mark:674265384777416705> Reset __all__ guild settings!",
|
||||
permission: "🔒 Permission requirement:",
|
||||
permissionsSetTrue: "<:green_check_mark:674265384777416705> Permissions requirement now set to: \`true\`",
|
||||
permissionsTrue: "<:redx:674263474704220182> That value is already `true`!",
|
||||
permissionsSetFalse: "<:green_check_mark:674265384777416705> Permissions requirement now set to: \`false\`",
|
||||
permissionsFalse: "<:redx:674263474704220182> That value is already `false`!",
|
||||
currentDefaultBass: ":speaker: Currect default bass level:",
|
||||
bassFalse: "<:green_check_mark:674265384777416705> Bass is now false!",
|
||||
bassLevel: "<:green_check_mark:674265384777416705> Bass level is now",
|
||||
announceSongsFalse: "<:green_check_mark:674265384777416705> announcesongs now set to `false`!",
|
||||
announceSongsTrue: "<:green_check_mark:674265384777416705> announcesongs now set to `true`!"
|
||||
};
|
@ -1,17 +1,18 @@
|
||||
module.exports = function (client, msg, command) {
|
||||
const serverQueue = client.queue.get(msg.guild.id);
|
||||
const permissions = msg.channel.permissionsFor(msg.author);
|
||||
if (!serverQueue || !serverQueue.playing) return msg.channel.send('<:redx:674263474704220182> There is nothing playing!');
|
||||
if (!serverQueue || !serverQueue.playing) return msg.channel.send(client.messages.noServerQueue);
|
||||
if (msg.author.id !== client.config.devId) {
|
||||
if (msg.member.voice.channel !== serverQueue.voiceChannel) return msg.channel.send(`<:redx:674263474704220182> I'm sorry but you need to be in the same voice channel as Musix to use this command!`);
|
||||
if (msg.member.voice.channel !== serverQueue.voiceChannel) return msg.channel.send(client.messages.wrongVoiceChannel);
|
||||
if (client.global.db.guilds[msg.guild.id].permissions === true) {
|
||||
if (client.global.db.guilds[msg.guild.id].dj) {
|
||||
if (!msg.member.roles.cache.has(client.global.db.guilds[msg.guild.id].djrole)) {
|
||||
msg.channel.send('<:redx:674263474704220182> You need the `DJ` role to use this command!');
|
||||
msg.channel.send(client.messages.noDj);
|
||||
return false;
|
||||
} else return true;
|
||||
} else if (!permissions.has(command.permission)) {
|
||||
msg.channel.send(`<:redx:674263474704220182> You need the \`${command.permission}\` permission to use this command!`);
|
||||
client.messages.noPerms = client.messages.noPerms.replace("%PERMS%", commands.permissions);
|
||||
msg.channel.send(client.messages.noPerms);
|
||||
return false;
|
||||
} else return true;
|
||||
} else return true;
|
||||
|
@ -1,13 +1,13 @@
|
||||
module.exports = function (msg, args, client, Discord, prefix, command) {
|
||||
const permissions = msg.channel.permissionsFor(msg.client.user);
|
||||
if (!permissions.has('EMBED_LINKS')) return msg.channel.send('<:redx:674263474704220182> I cannot send embeds (Embed links), make sure I have the proper permissions!');
|
||||
if (!permissions.has('USE_EXTERNAL_EMOJIS')) return msg.channel.send('<:redx:674263474704220182> I cannot use external emojis, make sure I have the proper permissions!');
|
||||
if (!permissions.has('EMBED_LINKS')) return msg.channel.send(client.messages.noPermsEmbed);
|
||||
if (!permissions.has('USE_EXTERNAL_EMOJIS')) return msg.channel.send(client.noPermsUseExternalEmojis);
|
||||
try {
|
||||
command.uses++;
|
||||
command.execute(msg, args, client, Discord, prefix, command);
|
||||
} catch (error) {
|
||||
const date = new Date();
|
||||
msg.reply(`<:redx:674263474704220182> there was an error trying to execute that command! Please contact support with \`${prefix}bug\`!`);
|
||||
msg.reply(client.messages.errorExe);
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setTitle(`Musix ${error.toString()}`)
|
||||
.setDescription(error.stack.replace(/at /g, '**at **'))
|
||||
|
@ -12,7 +12,8 @@ module.exports = async function (video, msg, voiceChannel, client, playlist = fa
|
||||
if (serverQueue) {
|
||||
serverQueue.songs.push(song);
|
||||
if (playlist) return;
|
||||
return msg.channel.send(`<:green_check_mark:674265384777416705> **${song.title}** has been added to the queue!`);
|
||||
client.messages.songsAdded = client.messages.songAdded.replace("%TITLE%", song.title);
|
||||
return msg.channel.send(client.messages.songAdded);
|
||||
}
|
||||
|
||||
const construct = require("../config/queueConfig.js");
|
||||
@ -32,8 +33,8 @@ module.exports = async function (video, msg, voiceChannel, client, playlist = fa
|
||||
client.funcs.play(msg.guild, construct.songs[0], client, 0, true);
|
||||
} catch (error) {
|
||||
client.queue.delete(msg.guild.id);
|
||||
client.debug_channel.send("Error with connecting to voice channel: " + error);
|
||||
return msg.channel.send(`<:redx:674263474704220182> An error occured: ${error}`);
|
||||
client.debug_channel.send(client.messages.errorConnecting + error);
|
||||
return msg.channel.send(client.messages.error);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ module.exports = async function (guild, song, client, seek, play) {
|
||||
client.debug_channel.send('Error with the dispatcher: ' + error);
|
||||
serverQueue.voiceChannel.leave();
|
||||
client.queue.delete(guild.id);
|
||||
return serverQueue.textChannel.send('<:redx:674263474704220182> An error has occured while playing music! The queue has been deleted.');
|
||||
return serverQueue.textChannel.send(client.messages.errorDispatcher);
|
||||
});
|
||||
dispatcher.setVolume(serverQueue.volume / 10);
|
||||
if (client.global.db.guilds[guild.id].startPlaying || play) {
|
||||
@ -30,7 +30,7 @@ module.exports = async function (guild, song, client, seek, play) {
|
||||
const songtime = (data.length_seconds * 1000).toFixed(0);
|
||||
const thumbnail = getThumb(serverQueue.songs[0].url);
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setTitle(`<a:aNotes:674602408105476106> Start playing: **${song.title}**`)
|
||||
.setTitle(`${client.messages.startPlaying}**${song.title}**`)
|
||||
.setDescription(`Song duration: \`${client.funcs.msToTime(songtime, "hh:mm:ss")}\``)
|
||||
.setThumbnail(thumbnail._rejectionHandler0)
|
||||
.setColor(client.config.embedColor)
|
||||
|
@ -1,16 +1,16 @@
|
||||
module.exports = async function (client, msg, youtube, voiceChannel, url) {
|
||||
if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
|
||||
const lmsg = await msg.channel.send('<a:loading:674284196700618783> Loading song(s)');
|
||||
const lmsg = await msg.channel.send(client.messages.loadingSongs);
|
||||
const playlist = await youtube.getPlaylist(url);
|
||||
const videos = await playlist.getVideos();
|
||||
for (const video of Object.values(videos)) {
|
||||
const video2 = await youtube.getVideoByID(video.id);
|
||||
await client.funcs.handleVideo(video2, msg, voiceChannel, client, true);
|
||||
}
|
||||
lmsg.edit(`<:green_check_mark:674265384777416705> Playlist: **${playlist.title}** has been added to the queue!`);
|
||||
client.messages.playlistAdded = client.messages.playlistAdded.replace("%TITLE%", playlist.title);
|
||||
lmsg.edit(client.messages.playlistAdded);
|
||||
return true;
|
||||
} else {
|
||||
console.log('return false')
|
||||
return false;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user