summaryrefslogtreecommitdiff
path: root/src/commands/utility
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-23 19:06:09 -0700
committer8cy <[email protected]>2020-04-23 19:06:09 -0700
commit8a2c9df3fd75a08d2b4acabe0b3a6bd62da22b34 (patch)
tree08e8b18aebae0b3836de94484185fabb14a860e8 /src/commands/utility
parentchange mongdburl to mlab, v7.4.2 (diff)
downloaddep-core-8a2c9df3fd75a08d2b4acabe0b3a6bd62da22b34.tar.xz
dep-core-8a2c9df3fd75a08d2b4acabe0b3a6bd62da22b34.zip
shift groups around, new mod cmds, v7.5.0
Diffstat (limited to 'src/commands/utility')
-rw-r--r--src/commands/utility/clear.ts77
-rw-r--r--src/commands/utility/clientid.ts29
-rw-r--r--src/commands/utility/invite.ts21
-rw-r--r--src/commands/utility/membercount.ts29
-rw-r--r--src/commands/utility/memorystats.ts34
-rw-r--r--src/commands/utility/memoryusage.ts27
-rw-r--r--src/commands/utility/server.ts54
-rw-r--r--src/commands/utility/servercount.ts28
-rw-r--r--src/commands/utility/uptime.ts39
-rw-r--r--src/commands/utility/version.ts35
10 files changed, 0 insertions, 373 deletions
diff --git a/src/commands/utility/clear.ts b/src/commands/utility/clear.ts
deleted file mode 100644
index 80e0c73..0000000
--- a/src/commands/utility/clear.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import emoji from 'emoji-random';
-
-module.exports = class ClearUtility extends Command {
- constructor(client) {
- super(client, {
- name: 'clear',
- aliases: ['delete', 'del', 'c', 'd'],
- group: 'utility',
- memberName: 'clear',
- description: 'Clears a specified amount of messages.',
- guildOnly: true,
- args: [
- {
- key: 'deleteAmount',
- prompt: 'How many messages would you like to delete?',
- type: 'integer'
- }
- ],
- examples: [
- 'uwu!clear 23',
- 'uwu!delete 75',
- 'uwu!del 32',
- 'uwu!c 45',
- 'uwu!d 84'
- ],
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES']
- });
- }
- async run(msg: CommandoMessage, { deleteAmount }) {
- if (msg.member.hasPermission('MANAGE_MESSAGES')) {
- if (!deleteAmount) {
- msg.reply('You haven\'t specified an amount of messages which should be deleted. ' + emoji.random()).then(deleteNotificationMessage => {
- // @ts-ignore
- deleteNotificationMessage.delete({ timeout: 1000 });
- });
- } else if (isNaN(deleteAmount)) {
- msg.reply('The amount parameter isn\'t a number. ' + emoji.random()).then(deleteNotificationMessage => {
- // @ts-ignore
- deleteNotificationMessage.delete({ timeout: 1000 });
- });
- } else if (deleteAmount > 100) {
- msg.reply('You can\'t delete more than 100 messages at once. ' + emoji.random()).then(deleteNotificationMessage => {
- // @ts-ignore
- deleteNotificationMessage.delete({ timeout: 1000 });
- });
- } else if (deleteAmount < 1) {
- msg.reply('You have to delete at least 1 message. ' + emoji.random()).then(deleteNotificationMessage => {
- // @ts-ignore
- deleteNotificationMessage.delete({ timeout: 1000 });
- });
- }
- /*else if (msg.createdTimestamp > 1209600) {
- msg.reply('due to discord rules, bots can only bulk delete messages that are under 14 days old :(')
- } */
- else {
- var clearAmount = deleteAmount + 1;
- // It took me so long to figure out why this was not really working. It would delete but an insane amount at a time.
- // I realized that because it was getting parsed as a string, it would just add 1 to it so if I tried to delete 1
- // message, it would delete 11 lol. Fixed by parsing as integer THEN adding one. 02:30 2020/04/03/2020
-
- await msg.channel.messages.fetch({
- limit: clearAmount
- }).then(messages => { // I am on v11 discord.js
- msg.channel.bulkDelete(messages);
- });
- msg.reply('It\'s been deleted ~uwu ' + emoji.random()).then(deleteNotificationMessage => {
- // @ts-ignore
- deleteNotificationMessage.delete({ timeout: 1000 });
- });
- }
- } else {
- msg.reply('Insufficent permsissions. ' + emoji.random());
- }
- }
-}; \ No newline at end of file
diff --git a/src/commands/utility/clientid.ts b/src/commands/utility/clientid.ts
deleted file mode 100644
index 28073c5..0000000
--- a/src/commands/utility/clientid.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import emoji from 'emoji-random';
-import { MessageEmbed } from 'discord.js';
-
-module.exports = class ClientIDUtility extends Command {
- constructor(client) {
- super(client, {
- name: 'clientid',
- aliases: ['cid'],
- group: 'utility',
- memberName: 'clientid',
- description: 'Tells you the bot\'s client ID version.',
- examples: ['uwu!clientid', 'uwu!cid'],
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
- });
- }
- run(msg: CommandoMessage) {
- msg.channel.send('Please wait...').then(m => {
- m.edit(`** **`);
-
- let emb = new MessageEmbed()
- .setDescription('uwufier\'s client ID is **699473263998271489**. ' + emoji.random())
- .setColor(0xFFCC4D)
-
- msg.channel.send(emb);
- });
- }
-}; \ No newline at end of file
diff --git a/src/commands/utility/invite.ts b/src/commands/utility/invite.ts
deleted file mode 100644
index 4e8150e..0000000
--- a/src/commands/utility/invite.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import emoji from 'emoji-random';
-import { MessageEmbed } from 'discord.js';
-
-module.exports = class InviteUtility extends Command {
- constructor(client) {
- super(client, {
- name: 'invite',
- aliases: ['inv'],
- group: 'utility',
- memberName: 'invite',
- description: 'Gives you the bot\'s invite link.',
- examples: ['uwu!invite', 'uwu!inv'],
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
- });
- }
- run(msg: CommandoMessage) {
- msg.reply('https://crack.cf/uwu')
- }
-}; \ No newline at end of file
diff --git a/src/commands/utility/membercount.ts b/src/commands/utility/membercount.ts
deleted file mode 100644
index 4d64f5d..0000000
--- a/src/commands/utility/membercount.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import emoji from 'emoji-random';
-
-module.exports = class MemberCountUtility extends Command {
- constructor(client) {
- super(client, {
- name: 'membercount',
- aliases: ['memberc', 'mcount', 'mc'],
- group: 'utility',
- memberName: 'membercount',
- description: 'Tells you how many members are in the current server.',
- throttling: {
- usages: 5,
- duration: 30
- },
- examples: [
- 'uwu!membercount',
- 'uwu!memberc',
- 'uwu!mcount',
- 'uwu!mc'
- ],
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
- });
- }
- run(msg: CommandoMessage) {
- msg.reply(`There are **${msg.guild.memberCount}** members in **${msg.guild.name}**. ` + emoji.random());
- }
-}; \ No newline at end of file
diff --git a/src/commands/utility/memorystats.ts b/src/commands/utility/memorystats.ts
deleted file mode 100644
index 0729fc5..0000000
--- a/src/commands/utility/memorystats.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-
-module.exports = class MemoryStatsUtility extends Command {
- constructor(client) {
- super(client, {
- name: 'memorystats',
- aliases: [
- 'memstats',
- 'mem-stats',
- 'memory-stats',
- 'memorystats',
- 'memstat',
- 'mem-stat',
- 'memory-stat',
- 'memorystat'
- ],
- group: 'utility',
- memberName: 'memorystats',
- description: 'Checks the full, current, approximate memory usage statistics of the bot\'s Node.js process.',
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
- });
- }
- run(msg: CommandoMessage) {
- const used = process.memoryUsage();
- msg.reply(`The full, current, approximate memory usage statistics are currentaly;
-\`\`\`js
-rss: ${Math.round(used.rss / 1024 / 1024 * 100) / 100} MBs
-heapTotal: ${Math.round(used.heapTotal / 1024 / 1024 * 100) / 100} MBs
-heapUsed: ${Math.round(used.heapUsed / 1024 / 1024 * 100) / 100} MBs
-external: ${Math.round(used.external / 1024 / 1024 * 100) / 100} MBs
-\`\`\``)
- }
-}; \ No newline at end of file
diff --git a/src/commands/utility/memoryusage.ts b/src/commands/utility/memoryusage.ts
deleted file mode 100644
index 3c2913a..0000000
--- a/src/commands/utility/memoryusage.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import emoji from 'emoji-random';
-
-module.exports = class MemoryUsageUtility extends Command {
- constructor(client) {
- super(client, {
- name: 'memoryusage',
- aliases: [
- 'memusage',
- 'mem-usage',
- 'memory-usage',
- 'mem',
- 'memory',
- 'memoryusage'
- ],
- group: 'utility',
- memberName: 'memoryusage',
- description: 'Checks the current, approximate memory usage of the bot\'s Node.js process.',
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
- });
- }
- run(msg: CommandoMessage) {
- const used = process.memoryUsage().heapUsed / 1024 / 1024;
- msg.reply(`The current, approximate memory usage is currently **${Math.round(used * 100) / 100}** MBs. ${emoji.random()}`)
- }
-}; \ No newline at end of file
diff --git a/src/commands/utility/server.ts b/src/commands/utility/server.ts
deleted file mode 100644
index f5fddca..0000000
--- a/src/commands/utility/server.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import { MessageEmbed } from 'discord.js';
-
-module.exports = class ServerUtility extends Command {
- constructor(client) {
- super(client, {
- name: 'server',
- aliases: [
- 'serverinfo',
- 'si',
- 'server-info',
- 'serverstats',
- 'server-stats'
- ],
- group: 'utility',
- memberName: 'server',
- description: 'Gives you information about the current server.',
- throttling: {
- usages: 2,
- duration: 60
- },
- guildOnly: true,
- examples: [
- 'uwu!server',
- 'uwu!serverinfo',
- 'uwu!server-info',
- 'uwu!serverstats',
- 'uwu!server-stats',
- 'uwu!si'
- ],
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
- });
- }
- run(msg: CommandoMessage) {
- var o = msg.guild.members.cache.filter(m => m.presence.status === 'online').size;
-
- let embed = new MessageEmbed()
-
- .setAuthor(`${msg.guild.name} - ${msg.guild.id}`, `${msg.guild.iconURL()}`, `https://discordapp.com/channels/${msg.guild.id}/${msg.guild.id}`)
- .setDescription(`Here\'s all the information on \`${msg.guild.name}\``)
- .setThumbnail(`${msg.guild.iconURL()}`)
- .addField('Owner', `${msg.guild.owner}`, false)
- .addField(`Members [${msg.guild.memberCount}]`, `${o} members are online.`, true)
- .addField('Region', `${msg.guild.region}`, true)
- .addField('Text channels', `${msg.guild.channels.cache.filter(c => c.type === 'text').size}`, true)
- .addField('Voice channels', `${msg.guild.channels.cache.filter(c => c.type === 'voice').size}`, true)
- .addField('Guild created', `${msg.guild.createdAt}`, false)
- .addField(`${this.client.user.username} joined`, `${msg.guild.members.cache.get('699473263998271489').joinedAt}`)
- .setColor(0xFFCC4D);
-
- msg.channel.send(embed);
- }
-}; \ No newline at end of file
diff --git a/src/commands/utility/servercount.ts b/src/commands/utility/servercount.ts
deleted file mode 100644
index eaccd89..0000000
--- a/src/commands/utility/servercount.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import { MessageEmbed } from 'discord.js';
-import emoji from 'emoji-random';
-
-module.exports = class ServerCountUtility extends Command {
- constructor(client) {
- super(client, {
- name: 'servercount',
- aliases: ['sc', 'scount', 'serverc'],
- group: 'utility',
- memberName: 'servercount',
- description: 'Tells you the amount of servers uwufy is in.',
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
- });
- }
- run(msg: CommandoMessage) {
- msg.channel.send('Please wait...').then(m => {
- m.edit(`** **`);
-
- let emb = new MessageEmbed()
- .setDescription(`Currently running on ${this.client.guilds.cache.size} server(s). ` + emoji.random())
- .setColor(0xFFCC4D)
-
- msg.channel.send(emb);
- });
- }
-}; \ No newline at end of file
diff --git a/src/commands/utility/uptime.ts b/src/commands/utility/uptime.ts
deleted file mode 100644
index dcce606..0000000
--- a/src/commands/utility/uptime.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import { duration as _duration } from 'moment';
-import 'moment-duration-format';
-import emoji from 'emoji-random';
-import { MessageEmbed } from 'discord.js';
-
-export default class UptimeUtility extends Command {
- constructor(client) {
- super(client, {
- name: 'uptime',
- aliases: ['ut'],
- group: 'utility',
- memberName: 'uptime',
- description: 'Tells you how long the bot has been online.',
- throttling: {
- usages: 5,
- duration: 30
- },
- examples: [
- 'uwu!uptime',
- 'uwu!ut'
- ],
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
- });
- }
- run(msg: CommandoMessage) {
- const duration = _duration(this.client.uptime).format(" D [days], H [hrs], m [mins], s [secs]");
- msg.channel.send('Please wait...').then(m => {
- m.edit(`** **`);
-
- let emb = new MessageEmbed()
- .setDescription('<@699473263998271489> has been up for ' + duration + '. ' + emoji.random())
- .setColor(0xFFCC4D)
-
- msg.channel.send(emb);
- });
- }
-} \ No newline at end of file
diff --git a/src/commands/utility/version.ts b/src/commands/utility/version.ts
deleted file mode 100644
index 0de170f..0000000
--- a/src/commands/utility/version.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
-import emoji from 'emoji-random';
-import { MessageEmbed } from 'discord.js';
-import config from '../../config.json';
-
-export default class VersionUtility extends Command {
- constructor(client) {
- super(client, {
- name: 'version',
- group: 'utility',
- memberName: 'version',
- description: 'Tells you the bot\'s current build version.',
- throttling: {
- usages: 5,
- duration: 30
- },
- examples: [
- 'uwu!version'
- ],
- userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
- clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
- });
- }
- run(msg: CommandoMessage) {
- msg.channel.send('Please wait...').then(m => {
- m.edit(`** **`);
-
- let emb = new MessageEmbed()
- .setDescription(`uwufier\'s current build version is **v${config['version']}**. ` + emoji.random())
- .setColor(0xFFCC4D)
-
- msg.channel.send(emb);
- });
- }
-} \ No newline at end of file