mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-23 00:23:17 +00:00
Update index.js
This commit is contained in:
parent
1f0180cf13
commit
54a8d3174d
59
index.js
59
index.js
@ -26,19 +26,18 @@ client.on('ready', () => { //startup stuff
|
|||||||
client.user.setStatus('dnd');
|
client.user.setStatus('dnd');
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('message', msg => {
|
client.on('message', async msg => {
|
||||||
if (msg.content === '!test') {
|
if (msg.author.bot) return undefined;
|
||||||
if (!msg.member.username === 'Matte') {
|
if (msg.content.startsWith(`${PREFIX}`)) {
|
||||||
msg.channel.send(':x: I\'m sorry, You can\'t do that!')
|
if (msg.content === '-test') {
|
||||||
}
|
|
||||||
if (msg.author.username === 'Matte') {
|
if (msg.author.username === 'Matte') {
|
||||||
msg.channel.send('Bot is currently online hosted!')
|
msg.channel.send('Bot is currently online hosted!')
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (msg.content === '!restart') {
|
if (msg.content === '-restart') {
|
||||||
if (!msg.member.username === 'Matte') {
|
if (msg.member.username !== 'Matte') {
|
||||||
msg.channel.send(':x: I\'m sorry, You can\'t do that!')
|
msg.channel.send(':x: I\'n´m sorry, You can\'t do that!')
|
||||||
}
|
}
|
||||||
if (msg.author.username === 'Matte') {
|
if (msg.author.username === 'Matte') {
|
||||||
console.log('restarting...')
|
console.log('restarting...')
|
||||||
@ -54,47 +53,38 @@ client.on('message', msg => {
|
|||||||
if (msg.content === `${PREFIX}help`) {
|
if (msg.content === `${PREFIX}help`) {
|
||||||
const embed = new Discord.RichEmbed()
|
const embed = new Discord.RichEmbed()
|
||||||
.setTitle('Commands for Musix!')
|
.setTitle('Commands for Musix!')
|
||||||
.addField('```!play```', 'Play a song.', true)
|
.addField('```-play```', 'Play a song.', true)
|
||||||
.addField('```!queue```', 'Display the queue.', true)
|
.addField('```-queue```', 'Display the queue.', true)
|
||||||
.addField('```!np```', 'Display whats currently playing.', true)
|
.addField('```-np```', 'Display whats currently playing.', true)
|
||||||
.addField('```!volume```', 'Change or check the volume.', true)
|
.addField('```-volume```', 'Change or check the volume.', true)
|
||||||
.addField('```!pause```', 'Pause the music.', true)
|
.addField('```-pause```', 'Pause the music.', true)
|
||||||
.addField('```!resume```', 'Resume the music.', true)
|
.addField('```-resume```', 'Resume the music.', true)
|
||||||
.addField('```!stop```', 'Stop the music, Clear the queue and leave the current voice channel.', true)
|
.addField('```-stop```', 'Stop the music, Clear the queue and leave the current voice channel.', true)
|
||||||
.addField('```!skip```', 'Skip a song.', true)
|
.addField('```-skip```', 'Skip a song.', true)
|
||||||
.addField('```!invite```', 'Invite Musix.', true)
|
.addField('```-invitemusix```', 'Invite Musix.', true)
|
||||||
.addField('```!info```', 'Display info and instructions.', true)
|
.addField('```-musixinfo```', 'Display info and instructions.', true)
|
||||||
.addField('```!help```', 'Display the help.', true)
|
.addField('```-musixhelp```', 'Display the help.', true)
|
||||||
.setAuthor('Musix', 'https://cdn.discordapp.com/avatars/572405135658188800/04c6f22b7600ddecfbc245dd3ec10f9f.png?size=2048')
|
.setAuthor('Musix', 'https://cdn.discordapp.com/avatars/572405135658188800/04c6f22b7600ddecfbc245dd3ec10f9f.png?size=2048')
|
||||||
.setColor('#b50002')
|
.setColor('#b50002')
|
||||||
msg.channel.send(embed);
|
msg.channel.send(embed);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (msg.content === `${PREFIX}info`) {
|
if (msg.content === `${PREFIX}info`) {
|
||||||
var dj = msg.guild.roles.find(x => x.name === 'DJ') ? true : false;
|
var line = '**>-----------------------------------------------------------------------<**';
|
||||||
const embed = new Discord.RichEmbed()
|
const embed = new Discord.RichEmbed()
|
||||||
.setTitle('**Musix instructions and info**:')
|
.setTitle('**Musix instructions and info**:')
|
||||||
.addField('On any errors you should use the !stop command, end the music and reset the queue.', 'Remember to __try again__ before contacting support!', true)
|
.addField('To use Musix you need a role called DJ !', line, true)
|
||||||
.addField('If your guild has a role called \'DJ\' you will need it to play music! If your guild doesn\'t have the DJ role everyone can play music.', 'DJ role existance: ' + dj, true)
|
.addField('If you have any problems with musix please contact Matte#5254!', line, true)
|
||||||
.addField('Musix support server', 'https://discord.gg/rvHuJtB', true)
|
|
||||||
.addField('If you encounter any problems with Musix please contact Matte#5254!', '(creator and developer of Musix)', true)
|
|
||||||
.setAuthor('Musix', 'https://cdn.discordapp.com/avatars/572405135658188800/04c6f22b7600ddecfbc245dd3ec10f9f.png?size=2048')
|
.setAuthor('Musix', 'https://cdn.discordapp.com/avatars/572405135658188800/04c6f22b7600ddecfbc245dd3ec10f9f.png?size=2048')
|
||||||
.setColor('#b50002')
|
.setColor('#b50002')
|
||||||
msg.channel.send(embed);
|
msg.channel.send(embed);
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
if (msg.content === `${PREFIX}invite`) {
|
if(msg.content === `${PREFIX}musixinvite`) {
|
||||||
msg.channel.send('https://bit.ly/2V3D0p7')
|
msg.channel.send('https://bit.ly/2V3D0p7')
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
client.on('message', async msg => {
|
|
||||||
if (msg.author.bot) return undefined;
|
|
||||||
if (msg.content.startsWith(`${PREFIX}`)) {
|
|
||||||
if (msg.member.guild.roles.find(x => x.name === 'DJ')) {
|
if (msg.member.guild.roles.find(x => x.name === 'DJ')) {
|
||||||
if (!msg.member.roles.find(x => x.name === 'DJ')) {
|
|
||||||
msg.channel.send(':x: i\'m sorry you need to have the \'DJ\' role!')
|
|
||||||
}
|
|
||||||
if (msg.member.roles.find(x => x.name === 'DJ')) {
|
if (msg.member.roles.find(x => x.name === 'DJ')) {
|
||||||
const args = msg.content.split(' ');
|
const args = msg.content.split(' ');
|
||||||
const searchString = args.slice(1).join(' ');
|
const searchString = args.slice(1).join(' ');
|
||||||
@ -208,6 +198,9 @@ Please provide a value to select one of the search results ranging from __1-10__
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!msg.member.roles.find(x => x.name === 'DJ')) {
|
||||||
|
msg.channel.send(':x: i\'m sorry you need to have the \'DJ\' role!')
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
const args = msg.content.split(' ');
|
const args = msg.content.split(' ');
|
||||||
const searchString = args.slice(1).join(' ');
|
const searchString = args.slice(1).join(' ');
|
||||||
|
Loading…
Reference in New Issue
Block a user