From 8f7ff164977954ad4cb6216c637424eca2634a0b Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Wed, 1 Jul 2020 21:44:05 +0300 Subject: [PATCH] Chore 3.7.2 --- package.json | 2 +- src/commands/nowplaying.js | 2 +- src/commands/system.js | 28 ++++++++++++++++++++++++++++ src/events/clientEvents/msg.js | 4 +++- src/struct/config/config.js | 2 +- src/struct/config/messages.js | 2 +- 6 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 src/commands/system.js diff --git a/package.json b/package.json index c83c7ece..9aaaa6d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "musix", - "version": "3.7.1", + "version": "3.7.2", "description": "V3 for Musix the discord music bot", "main": "./index.js", "scripts": { diff --git a/src/commands/nowplaying.js b/src/commands/nowplaying.js index f19ee741..fd80c8de 100644 --- a/src/commands/nowplaying.js +++ b/src/commands/nowplaying.js @@ -35,7 +35,7 @@ module.exports = { ) .setFooter(`Queued by ${queue.songs[0].author.tag}`) .setURL(queue.songs[0].url) - .setThumbnail(queue.songs[0].info.thumbnail.thumbnails[4].url) + .setThumbnail(queue.songs[0].info.thumbnail.thumbnails[4].url || queue.songs[0].info.thumbnail.thumbnails[3].url || queue.songs[0].info.thumbnail.thumbnails[2].url || queue.songs[0].info.thumbnail.thumbnails[1].url || queue.songs[0].info.thumbnail.thumbnails[0].url) .setColor(client.config.embedColor); if (queue.nigthCore) embed.setDescription( diff --git a/src/commands/system.js b/src/commands/system.js new file mode 100644 index 00000000..90d8ed49 --- /dev/null +++ b/src/commands/system.js @@ -0,0 +1,28 @@ +module.exports = { + name: 'system', + alias: ["sys", "sysinfo"], + usage: '', + description: 'See system information', + onlyDev: true, + permission: 'none', + category: 'info', + execute(msg, args, client, Discord, command) { + const uptime = client.funcs.msToTime(client.uptime, "dd:hh:mm:ss"); + msg.channel.send(client.messages.pinging).then(m => { + const latency = m.createdTimestamp - msg.createdTimestamp; + + const embed = new Discord.MessageEmbed() + .setTitle(client.messages.statusTitle) + .addField(client.messages.statusField1, client.ws.ping, true) + .addField(client.messages.statusField2, latency, true) + .addField(client.messages.statusField3, uptime, true) + .addField(client.messages.statusField4, client.shard.ids) + .addField("ram usage", `${process.memoryUsage().heapUsed} / ${process.memoryUsage().heapTotal}`, true) + .addField("cpu usage", process.cpuUsage().system, true) + .setAuthor(client.user.username, client.user.displayAvatarURL) + .setColor(client.config.embedColor) + m.delete(); + return msg.channel.send(embed); + }); + } +}; \ No newline at end of file diff --git a/src/events/clientEvents/msg.js b/src/events/clientEvents/msg.js index a11eab69..c7a211da 100644 --- a/src/events/clientEvents/msg.js +++ b/src/events/clientEvents/msg.js @@ -1,3 +1,5 @@ +const ms = require("ms"); + module.exports = { name: "message", async execute(client, msg, Discord) { @@ -35,7 +37,7 @@ function getCommand(client, args, msg, Discord) { (cmd) => cmd.alias && cmd.alias.includes(commandName) ); if (!command) return; - if (command.onlyDev && msg.author.id !== client.config.devId) return; + if (command.onlyDev && msg.author.id !== client.config.devId) return msg.channel.send(client.messages.onlyDev); if (client.config.devMode && msg.member.id !== client.config.devId && msg.guild.id !== "718081535240306738") return msg.channel.send(client.messages.devMode); client.funcs.exe(msg, args, client, Discord, command); diff --git a/src/struct/config/config.js b/src/struct/config/config.js index 6bab0501..aa661ef1 100644 --- a/src/struct/config/config.js +++ b/src/struct/config/config.js @@ -24,7 +24,7 @@ module.exports = { embedColor: "#b50002", invite: "https://discordapp.com/oauth2/authorize?client_id=607266889537945605&permissions=3427328&scope=bot", supportServer: "https://discord.gg/rvHuJtB", - devMode: false, + devMode: true, api: false, saveDB: true, respawn: true, diff --git a/src/struct/config/messages.js b/src/struct/config/messages.js index 5d1ea9ed..24abc83a 100644 --- a/src/struct/config/messages.js +++ b/src/struct/config/messages.js @@ -122,7 +122,7 @@ module.exports = { "I'm sorry but you need to be in a voice channel to play music!", nowPlaying: "__Now playing__", nowPremium: ":tada: Guild %GUILD% is now premium!", - onlyDev: emojis.redx + "This command is only available for dev(s)!", + onlyDev: emojis.redx + "This command is only available for the bots owner!", paused: emojis.pause + "Paused the music!", permission: "🔒 Permission requirement:", permissionsFalse: emojis.redx + "That value is already `false`!",