From 68d32ab1fa9c79e848038ca1c451e7d8f368531b Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Wed, 29 Apr 2020 04:36:14 -0700 Subject: Cerasus, v9.0.0 basically just add an insane amount of things - all new animal commands - waifu cmds - change/ move clientid, invite, uwufy, support, howify, say, pfp - add ip, security key, vote, datefacts, githubzen, fmk, fml, offsptring, facts, rate, opinion, onion, quantum coin, rolldie, romannumerals, russianrullete, smashorpass, spoiler, sub - minecraft cmds - SERVER check cmds - lewd cmds - roleplay commands - fun commands and games - utils --- src/commands/minecraft/getbody.ts | 45 +++++++++++++++ src/commands/minecraft/getface.ts | 43 ++++++++++++++ src/commands/minecraft/gethead.ts | 43 ++++++++++++++ src/commands/minecraft/getminime.ts | 59 ++++++++++++++++++++ src/commands/minecraft/getskin.ts | 43 ++++++++++++++ src/commands/minecraft/minecraftserverstatus.ts | 74 +++++++++++++++++++++++++ 6 files changed, 307 insertions(+) create mode 100644 src/commands/minecraft/getbody.ts create mode 100644 src/commands/minecraft/getface.ts create mode 100644 src/commands/minecraft/gethead.ts create mode 100644 src/commands/minecraft/getminime.ts create mode 100644 src/commands/minecraft/getskin.ts create mode 100644 src/commands/minecraft/minecraftserverstatus.ts (limited to 'src/commands/minecraft') diff --git a/src/commands/minecraft/getbody.ts b/src/commands/minecraft/getbody.ts new file mode 100644 index 0000000..3fb6eec --- /dev/null +++ b/src/commands/minecraft/getbody.ts @@ -0,0 +1,45 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; + +module.exports = class GetBodyMinecraft extends Command { + constructor(client) { + super(client, { + name: 'getbody', + aliases: [ + 'get-body', + 'getmcbody', + 'get-mc-body', + 'gmcb' + ], + group: 'minecraft', + memberName: 'getbody', + description: 'Grabs a specified player\'s body from Minecraft.', + examples: [ + 'uwu!getbody notch', + 'uwu!gmcb sin' + ], + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + throttling: { + usages: 5, + duration: 30 + }, + args: [ + { + key: 'uUsername', + prompt: 'What is the account name of the user?', + type: 'string' + } + ] + }); + } + async run(msg: CommandoMessage, { uUsername }) { + let emb = new MessageEmbed() + .setColor(0xFFCC4D) + .setAuthor(uUsername, `https://minotar.net/body/${encodeURIComponent(uUsername)}`) + .setImage(`https://minotar.net/body/${encodeURIComponent(uUsername)}`) + + //console.debug(`URL for ${uUsername}:`, emb.image?.url) + msg.reply(emb) + } +}; \ No newline at end of file diff --git a/src/commands/minecraft/getface.ts b/src/commands/minecraft/getface.ts new file mode 100644 index 0000000..b53e6fb --- /dev/null +++ b/src/commands/minecraft/getface.ts @@ -0,0 +1,43 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; + +module.exports = class GetFaceMinecraft extends Command { + constructor(client) { + super(client, { + name: 'getface', + aliases: [ + 'get-face', + 'getmcface', + 'get-mc-face', + 'gmcf' + ], + group: 'minecraft', + memberName: 'getface', + description: 'Grabs a specified player\'s face from Minecraft.', + examples: [ + 'uwu!getface notch', + 'uwu!gmcf sin' + ], + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + throttling: { + usages: 5, + duration: 30 + }, + args: [ + { + key: 'uUsername', + prompt: 'What is the account name of the user?', + type: 'string' + } + ] + }); + } + async run(msg: CommandoMessage, { uUsername }) { + let emb = new MessageEmbed() + .setColor(0xFFCC4D) + .setAuthor(uUsername, `https://minotar.net/helm/${encodeURIComponent(uUsername)}`) + .setImage(`https://minotar.net/helm/${encodeURIComponent(uUsername)}`) + msg.reply(emb) + } +}; \ No newline at end of file diff --git a/src/commands/minecraft/gethead.ts b/src/commands/minecraft/gethead.ts new file mode 100644 index 0000000..665d01e --- /dev/null +++ b/src/commands/minecraft/gethead.ts @@ -0,0 +1,43 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; + +module.exports = class GetHeadMinecraft extends Command { + constructor(client) { + super(client, { + name: 'gethead', + aliases: [ + 'get-head', + 'getmchead', + 'get-mc-head', + 'gmch' + ], + group: 'minecraft', + memberName: 'gethead', + description: 'Grabs a specified player\'s head from Minecraft.', + examples: [ + 'uwu!gethead notch', + 'uwu!gmch sin' + ], + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + throttling: { + usages: 5, + duration: 30 + }, + args: [ + { + key: 'uUsername', + prompt: 'What is the account name of the user?', + type: 'string' + } + ] + }); + } + async run(msg: CommandoMessage, { uUsername }) { + let emb = new MessageEmbed() + .setColor(0xFFCC4D) + .setAuthor(uUsername, `https://minotar.net/helm/${encodeURIComponent(uUsername)}`) + .setImage(`https://minotar.net/cube/${encodeURIComponent(uUsername)}/100.png`) + msg.reply(emb) + } +}; \ No newline at end of file diff --git a/src/commands/minecraft/getminime.ts b/src/commands/minecraft/getminime.ts new file mode 100644 index 0000000..c948d38 --- /dev/null +++ b/src/commands/minecraft/getminime.ts @@ -0,0 +1,59 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; + +module.exports = class GetMiniMeMinecraft extends Command { + constructor(client) { + super(client, { + name: 'getminime', + aliases: [ + 'get-mini-me', + 'getmcminime', + 'get-mc-mini-me', + 'gmcmm' + ], + group: 'minecraft', + memberName: 'getminime', + description: 'Grabs a specified player\'s skin from Minecraft.', + examples: [ + 'uwu!getminime notch', + 'uwu!gmcmm sin false' + ], + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + throttling: { + usages: 5, + duration: 30 + }, + args: [ + { + key: 'uUsername', + prompt: 'What is the account name of the user?', + type: 'string' + }, + { + key: 'uTrans', + prompt: 'Would you like the background to be transparant? (yes or no)', + type: 'string', + default: true + } + ] + }); + } + async run(msg: CommandoMessage, { uUsername, uTrans }) { + //console.debug('Transparency value:', uTrans) + + let emb = new MessageEmbed() + .setColor(0xFFCC4D) + .setAuthor(uUsername, `http://minecraftskinavatar.com/customize?id=${encodeURIComponent(uUsername)}&source=minecraft`, `https://minotar.net/helm/${encodeURIComponent(uUsername)}`) + .setFooter('[Provided by minecraftskinavatar.com](Provided by minecraftskinavatar.com)') + + if (uTrans) { + emb.setImage(`http://avatar.yourminecraftservers.com/avatar/trnsp/steve/tall/128/${encodeURIComponent(uUsername)}.png`) + } else { + emb.setImage(`http://avatar.yourminecraftservers.com/avatar/rad/steve/tall/128/${encodeURIComponent(username)}.png`) + } + + //console.debug(`Image URL for ${uUsername}: ${emb.image?.url}`) + msg.reply(emb) + } +}; \ No newline at end of file diff --git a/src/commands/minecraft/getskin.ts b/src/commands/minecraft/getskin.ts new file mode 100644 index 0000000..ff2deb2 --- /dev/null +++ b/src/commands/minecraft/getskin.ts @@ -0,0 +1,43 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; + +module.exports = class GetSkinMinecraft extends Command { + constructor(client) { + super(client, { + name: 'getskin', + aliases: [ + 'get-skin', + 'getmcskin', + 'get-mc-skin', + 'gmcs' + ], + group: 'minecraft', + memberName: 'getskin', + description: 'Grabs a specified player\'s skin from Minecraft.', + examples: [ + 'uwu!getskin notch', + 'uwu!gmcs sin' + ], + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + throttling: { + usages: 5, + duration: 30 + }, + args: [ + { + key: 'uUsername', + prompt: 'What is the account name of the user?', + type: 'string' + } + ] + }); + } + async run(msg: CommandoMessage, { uUsername }) { + let emb = new MessageEmbed() + .setColor(0xFFCC4D) + .setAuthor(uUsername, `https://minotar.net/helm/${encodeURIComponent(uUsername)}`) + .setImage(`https://minotar.net/skin/${encodeURIComponent(uUsername)}`) + msg.reply(emb) + } +}; \ No newline at end of file diff --git a/src/commands/minecraft/minecraftserverstatus.ts b/src/commands/minecraft/minecraftserverstatus.ts new file mode 100644 index 0000000..156a04f --- /dev/null +++ b/src/commands/minecraft/minecraftserverstatus.ts @@ -0,0 +1,74 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; +import axios from 'axios' +import emoji from 'emoji-random' + +module.exports = class MinecraftServerMinecraft extends Command { + constructor(client) { + super(client, { + name: 'minecraftserverstatus', + aliases: [ + 'mcserverstatus', + 'minecraft-server-status', + 'mcss' + ], + group: 'utility', + memberName: 'minecraftserverstatus', + description: 'Grabs you the server status of a Minecraft server.', + examples: [ + 'uwu!minecraftserverstatus', + 'uwu!mcss' + ], + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + throttling: { + usages: 5, + duration: 30 + }, + args: [ + { + key: 'ip', + prompt: 'What is the IP of the server?', + type: 'string' + }, + { + key: 'port', + prompt: 'What is the port of the server?', + type: 'integer', + default: '25565', + max: 65535, + min: 1 + } + ] + }); + } + async run(msg: CommandoMessage, { ip, port }) { + const res = ( + await axios(`https://mcapi.us/server/status?ip=${ip}&port=${port}`).catch(err => { + console.error(err) + return msg.reply('Woops, an error has occured. ' + emoji.random()) + }) + ).data + + if (res.status !== 'success') { + return msg.reply('Woops, there was an error with your request. ' + emoji.random()) + } + + let emb = new MessageEmbed() + .setTitle(ip) + .setTimestamp(res.last_updated) + .setColor(0xFFCC4D) + + if (res.online) { + emb.addField('Server Status', 'Currentaly online.', true) + emb.addField('Version', res.server.name, true) + emb.addField('Members', `${res.players.now}/${res.players.max}`, true) + emb.addField('MOTD', `\`\`\`${res.motd}\`\`\``, true) + } else if (res.last_online) { + emb.addField('Server Status', `Offline. Last seen ${new Date(res.last_online)}`, true) + } else { + emb.addField('Server Status', 'Offline. Never seen online before.', true) + } + return msg.reply(emb) + } +}; \ No newline at end of file -- cgit v1.2.3