-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
1,449 additions
and
1,258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
node_modules/ | ||
|
||
json.sqlite | ||
config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
const os = require('os'); | ||
const { MessageEmbed } = require('discord.js'); | ||
exports.run = async (client, message) => { | ||
let delay = ms => new Promise(res => setTimeout(res, ms)); | ||
|
||
function cpuaverage() { | ||
var totalIdle = 0, totalTick = 0; | ||
var cpus = os.cpus(); | ||
for (var i = 0, len = cpus.length; i < len; i++) { | ||
var cpu = cpus[i]; | ||
for (type in cpu.times) { | ||
totalTick += cpu.times[type]; | ||
} | ||
totalIdle += cpu.times.idle; | ||
} | ||
return { idle: totalIdle / cpus.length, total: totalTick / cpus.length }; | ||
} | ||
|
||
async function msg() { | ||
var startMeasure = cpuaverage(); | ||
await delay(100); | ||
var endMeasure = cpuaverage(); | ||
var percentagecpu = 100 - ~~(100 * (endMeasure.idle - startMeasure.idle) / (endMeasure.total - startMeasure.total)); | ||
|
||
let emb = new MessageEmbed() | ||
.setTitle("Bot Info") | ||
.setColor(client.color) | ||
.setThumbnail(client.thumbnail) | ||
.addField("Bot's memory usage [" + ((process.memoryUsage().heapUsed / os.totalmem()) * 100).toFixed(2) + "%]", (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + " MB / " + (((os.totalmem() / 1024) / 1024) / 1024).toFixed(2) + " GB", true) | ||
.addField("Cpu usage [" + percentagecpu + "%]", (process.cpuUsage().user / 1024 / 1024).toFixed(2) + " MB | " + os.cpus().length + (os.cpus().length === 1 ? " Core" : " Cores"), true) | ||
.addField("\u200b", "\u200b", true) | ||
.addField("Mem usage [" + Math.floor(((os.totalmem() - os.freemem()) / os.totalmem()) * 100) + "%]", ((((os.totalmem() - os.freemem()) / 1024) / 1024) / 1024).toFixed(2) + " GB / " + (((os.totalmem() / 1024) / 1024) / 1024).toFixed(2) + " GB", true) | ||
.addField("Node Js version", process.versions.node, true) | ||
.addField("\u200b", "\u200b", true) | ||
.addField("Platform", process.platform.replace(/win32/g, "Windows"), true) | ||
.addField("Architecture", os.arch(), true) | ||
.addField("\u200b", "\u200b", true) | ||
.addField("Bot's Uptime", client.function.timeformat(client.uptime / 1000), false) | ||
.setFooter(client.footer) | ||
message.channel.send({ embeds: [emb] }); | ||
} | ||
|
||
if (client.config.ownerid) | ||
if (message.author.id === client.config.ownerid) msg(); | ||
else message.channel.send('```css\nThis command is locked for owner```'); | ||
else msg(); | ||
}; | ||
|
||
exports.conf = { | ||
aliases: ['binfo'], | ||
permissions: ['SEND_MESSAGES', 'EMBED_LINKS'] | ||
const os = require('os'); | ||
const moment = require('moment'); | ||
const { MessageEmbed } = require('discord.js'); | ||
exports.run = async (client, message) => { | ||
let delay = ms => new Promise(res => setTimeout(res, ms)); | ||
|
||
function cpuaverage() { | ||
var totalIdle = 0, totalTick = 0; | ||
var cpus = os.cpus(); | ||
for (var i = 0, len = cpus.length; i < len; i++) { | ||
var cpu = cpus[i]; | ||
for (type in cpu.times) { | ||
totalTick += cpu.times[type]; | ||
} | ||
totalIdle += cpu.times.idle; | ||
} | ||
return { idle: totalIdle / cpus.length, total: totalTick / cpus.length }; | ||
} | ||
|
||
async function msg() { | ||
var startMeasure = cpuaverage(); | ||
await delay(100); | ||
var endMeasure = cpuaverage(); | ||
var percentagecpu = 100 - ~~(100 * (endMeasure.idle - startMeasure.idle) / (endMeasure.total - startMeasure.total)); | ||
|
||
let emb = new MessageEmbed() | ||
.setTitle("Bot Information") | ||
.setColor("#fffff") | ||
.addField("Bot's memory usage [" + ((process.memoryUsage().heapUsed / os.totalmem()) * 100).toFixed(2) + "%]", (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + " MB / " + (((os.totalmem() / 1024) / 1024) / 1024).toFixed(2) + " GB", true) | ||
.addField("Cpu usage [" + percentagecpu + "%]", (process.cpuUsage().user / 1024 / 1024).toFixed(2) + " MB | " + os.cpus().length + (os.cpus().length === 1 ? " Core" : " Cores"), true) | ||
.addField("\u200b", "\u200b", true) | ||
.addField("Mem usage [" + Math.floor(((os.totalmem() - os.freemem()) / os.totalmem()) * 100) + "%]", ((((os.totalmem() - os.freemem()) / 1024) / 1024) / 1024).toFixed(2) + " GB / " + (((os.totalmem() / 1024) / 1024) / 1024).toFixed(2) + " GB", true) | ||
.addField("Node Js version", process.versions.node, true) | ||
.addField("\u200b", "\u200b", true) | ||
.addField("Platform", process.platform.replace(/win32/g, "Windows"), true) | ||
.addField("Architecture", os.arch(), true) | ||
.addField("\u200b", "\u200b", true) | ||
.addField("Bot's Uptime", client.function.timeformat(client.uptime / 1000), false) | ||
.setFooter(moment().format('MMMM Do YYYY, h:mm:ss a')) | ||
message.channel.send({ embeds: [emb] }); | ||
} | ||
|
||
if (client.config.ownerid) | ||
if (message.author.id === client.config.ownerid) msg(); | ||
else message.channel.send('```css\nThis command is locked for owner```'); | ||
else msg(); | ||
}; | ||
|
||
exports.conf = { | ||
aliases: ['binfo'], | ||
permissions: ['SEND_MESSAGES', 'EMBED_LINKS'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
const { MessageEmbed } = require('discord.js'); | ||
exports.run = async (client, message, args) => { | ||
if (args[0] && !isNaN(args[0])) return message.channel.send("Command name cannot be a number"); | ||
if (!args[0]) args[0] = 'none'; | ||
|
||
switch (args[0].toLowerCase()) { | ||
case ('ban'): | ||
message.channel.send("```css\n" + client.config.prefix + "ban <Page Number>\nAlias: " + client.config.prefix + "s```"); | ||
break; | ||
case ('serverinfo'): | ||
message.channel.send("```css\n" + client.config.prefix + "serverinfo <Serial Number from Status command>\nAlias: " + client.config.prefix + "sinfo```"); | ||
break; | ||
case ('kick'): | ||
message.channel.send("```css\n" + client.config.prefix + "kick <Serverid | ip:port | Serial No. from Status command> <page number>\nAlias: " + client.config.prefix + "p, " + client.config.prefix + "scoreboard```"); | ||
break; | ||
case ('mute'): | ||
message.channel.send("```css\n" + client.config.prefix + "mute <name of the player | xuid of the player>\nAlias: " + client.config.prefix + "f```"); | ||
break; | ||
case ('warn'): | ||
message.channel.send("```css\n" + client.config.prefix + "warn <client id from " + client.config.webfronturl + ">\nAlias: none```"); | ||
break; | ||
case ('logs'): | ||
message.channel.send("```css\n" + client.config.prefix + "logs\nMethod: Your id and password for " + client.config.webfronturl + " will be asked in DM```"); | ||
break; | ||
case ('invite'): | ||
message.channel.send("```css\n" + client.config.prefix + "invite\nAlias: none```"); | ||
break; | ||
case ('profile'): | ||
message.channel.send("```css\n" + client.config.prefix + "profile <Serverid | ip:port | Serial No. from Status command> <!help>\nAlias: " + client.config.prefix + "e```"); | ||
break; | ||
case ('botinfo'): | ||
message.channel.send("```css\n" + client.config.prefix + "botinfo\nAlias: " + client.config.prefix + "binfo```"); | ||
break; | ||
case ('ping'): | ||
message.channel.send("```css\n" + client.config.prefix + "ping\nAlias: none```"); | ||
break; | ||
default: | ||
const emc = new MessageEmbed() | ||
.setTitle('Help') | ||
.setColor(client.color) | ||
.setThumbnail(client.thumbnail) | ||
.setDescription("🔸 `" + client.config.prefix + "ban` - Shows all iw4m admin server's status\n" + "🔹 `" + client.config.prefix + "serverinfo` - Shows info about given server number\n" + "🔸 `" + client.config.prefix + "kick` - Shows player scoreboard for the given server\n" + "🔹 `" + client.config.prefix + "mute` - Shows name, iw4m client id and xuid of found clients\n" + "🔸 `" + client.config.prefix + "warn` - Shows all stats about the player\n" + "🔹 `" + client.config.prefix + "logs` - Asks you for login info in dm\n" + "🔸 `" + client.config.prefix + "invite` - Deletes your login and logs you out\n" + "🔹 `" + client.config.prefix + "profile` - profiles the command in the given server\n" + "🔹 `" + client.config.prefix + "botinfo` - Shows bot's overall status\n" + "🔸 `" + client.config.prefix + "ping` - Shows bot's latency to discord\n" + "```Use " + client.config.prefix + "help <command name> or " + client.config.prefix + "h <command name> to get more info about the command```") | ||
.setFooter(client.footer); | ||
message.channel.send({ embeds: [emc] }); | ||
} | ||
}; | ||
|
||
exports.conf = { | ||
aliases: ['h'], | ||
permissions: ['SEND_MESSAGES', 'EMBED_LINKS'] | ||
const { MessageEmbed } = require('discord.js'); | ||
exports.run = async (client, message, args) => { | ||
if (args[0] && !isNaN(args[0])) return message.channel.send("Command name cannot be a number"); | ||
if (!args[0]) args[0] = 'none'; | ||
|
||
switch (args[0].toLowerCase()) { | ||
case ('ban'): | ||
message.channel.send("```css\n" + client.config.prefix + "ban <Page Number>\nAlias: " + client.config.prefix + "s```"); | ||
break; | ||
case ('serverinfo'): | ||
message.channel.send("```css\n" + client.config.prefix + "serverinfo <Serial Number from Status command>\nAlias: " + client.config.prefix + "sinfo```"); | ||
break; | ||
case ('kick'): | ||
message.channel.send("```css\n" + client.config.prefix + "kick <Serverid | ip:port | Serial No. from Status command> <page number>\nAlias: " + client.config.prefix + "p, " + client.config.prefix + "scoreboard```"); | ||
break; | ||
case ('mute'): | ||
message.channel.send("```css\n" + client.config.prefix + "mute <name of the player | xuid of the player>\nAlias: " + client.config.prefix + "f```"); | ||
break; | ||
case ('warn'): | ||
message.channel.send("```css\n" + client.config.prefix + "warn <client id from " + client.config.webfronturl + ">\nAlias: none```"); | ||
break; | ||
case ('logs'): | ||
message.channel.send("```css\n" + client.config.prefix + "logs\nMethod: Your id and password for " + client.config.webfronturl + " will be asked in DM```"); | ||
break; | ||
case ('invite'): | ||
message.channel.send("```css\n" + client.config.prefix + "invite\nAlias: none```"); | ||
break; | ||
case ('profile'): | ||
message.channel.send("```css\n" + client.config.prefix + "profile <Serverid | ip:port | Serial No. from Status command> <!help>\nAlias: " + client.config.prefix + "e```"); | ||
break; | ||
case ('botinfo'): | ||
message.channel.send("```css\n" + client.config.prefix + "botinfo\nAlias: " + client.config.prefix + "binfo```"); | ||
break; | ||
case ('ping'): | ||
message.channel.send("```css\n" + client.config.prefix + "ping\nAlias: none```"); | ||
break; | ||
default: | ||
const emc = new MessageEmbed() | ||
.setTitle('Help') | ||
.setColor(client.color) | ||
.setThumbnail(client.thumbnail) | ||
.setDescription("🔸 `" + client.config.prefix + "ban` - Shows all iw4m admin server's status\n" + "🔹 `" + client.config.prefix + "serverinfo` - Shows info about given server number\n" + "🔸 `" + client.config.prefix + "kick` - Shows player scoreboard for the given server\n" + "🔹 `" + client.config.prefix + "mute` - Shows name, iw4m client id and xuid of found clients\n" + "🔸 `" + client.config.prefix + "warn` - Shows all stats about the player\n" + "🔹 `" + client.config.prefix + "logs` - Asks you for login info in dm\n" + "🔸 `" + client.config.prefix + "invite` - Deletes your login and logs you out\n" + "🔹 `" + client.config.prefix + "profile` - profiles the command in the given server\n" + "🔹 `" + client.config.prefix + "botinfo` - Shows bot's overall status\n" + "🔸 `" + client.config.prefix + "ping` - Shows bot's latency to discord\n" + "```Use " + client.config.prefix + "help <command name> or " + client.config.prefix + "h <command name> to get more info about the command```") | ||
.setFooter(client.footer); | ||
message.channel.send({ embeds: [emc] }); | ||
} | ||
}; | ||
|
||
exports.conf = { | ||
aliases: ['h'], | ||
permissions: ['SEND_MESSAGES', 'EMBED_LINKS'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
const { MessageEmbed } = require('discord.js'); | ||
exports.run = (client, message) => { | ||
const embed = new MessageEmbed() | ||
.setTitle('🌐 Your ping is: ' + Math.floor(client.ws.ping) + 'ms') | ||
.setColor(client.color) | ||
message.channel.send({ embeds: [embed] }); | ||
}; | ||
|
||
exports.conf = { | ||
aliases: [], | ||
permissions: ['SEND_MESSAGES', 'EMBED_LINKS'] | ||
const { MessageEmbed } = require('discord.js'); | ||
exports.run = (client, message) => { | ||
const embed = new MessageEmbed() | ||
.setTitle('🌐 Your ping is: ' + Math.floor(client.ws.ping) + 'ms') | ||
.setColor(client.color) | ||
message.channel.send({ embeds: [embed] }); | ||
}; | ||
|
||
exports.conf = { | ||
aliases: [], | ||
permissions: ['SEND_MESSAGES', 'EMBED_LINKS'] | ||
}; |
Oops, something went wrong.