1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 03:33:17 +00:00

Update index.js

This commit is contained in:
MatteZ02 2019-07-25 16:58:02 +03:00
parent c5ca2ec569
commit 2ee9414b90

View File

@ -19,12 +19,24 @@ client.on('message', async msg => {
if (msg.content.startsWith(`${PREFIX}`)) { if (msg.content.startsWith(`${PREFIX}`)) {
var guildms = client.guilds.find(x => x.name === 'Musix Support') var guildms = client.guilds.find(x => x.name === 'Musix Support')
var channelms = guildms.channels.find(x => x.name === 'log') var channelms = guildms.channels.find(x => x.name === 'log')
const embed = new Discord.RichEmbed() var guildId = msg.guild.id
.setTitle(`**User:** ${msg.author.id}, ${msg.member.displayName}`) if (!client.voiceConnections.has(guildId)) {
.addField(`**Message channel:** ${msg.channel.name}`, `Message Guild: ${msg.guild.name}`) const embed = new Discord.RichEmbed()
.setFooter(`**Message Content:** ${msg.content}`) .setTitle(`**User:** ${msg.author.id}, ${msg.member.displayName}, ${msg.author.tag}`)
.setColor('#b50002') .addField(`**Message channel:** ${msg.channel.name}`, `Client is not in a Voice channel.`)
channelms.send(embed) .addField(`**Message Content:** ${msg.content}`, `**Message Guild:** ${msg.guild.name}, ${msg.guild.id}`)
.setColor('#b50002')
channelms.send(embed)
} else {
const embed = new Discord.RichEmbed()
.setTitle(`**User:** ${msg.author.id}, ${msg.member.displayName}, ${msg.author.tag}`)
.addField(`**Message channel:** ${msg.channel.name}`, `**Voice channel:** ${client.voiceConnections.get(guildId).channel.name}, User Voice channel: ${msg.member.voiceChannel}`)
.addField(`**Message Content:** ${msg.content}`, `**Message Guild:** ${msg.guild.name}, ${msg.guild.id}`)
.setColor('#b50002')
channelms.send(embed)
}
if (msg.content === `${PREFIX}ping`) { if (msg.content === `${PREFIX}ping`) {
msg.channel.send(`My current Ping: **${Math.floor(client.ping * 10) / 10} ms**.`) msg.channel.send(`My current Ping: **${Math.floor(client.ping * 10) / 10} ms**.`)
return; return;