diff options
| author | 8cy <[email protected]> | 2020-04-23 19:06:09 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-23 19:06:09 -0700 |
| commit | 8a2c9df3fd75a08d2b4acabe0b3a6bd62da22b34 (patch) | |
| tree | 08e8b18aebae0b3836de94484185fabb14a860e8 /src/commands/bot | |
| parent | change mongdburl to mlab, v7.4.2 (diff) | |
| download | dep-core-8a2c9df3fd75a08d2b4acabe0b3a6bd62da22b34.tar.xz dep-core-8a2c9df3fd75a08d2b4acabe0b3a6bd62da22b34.zip | |
shift groups around, new mod cmds, v7.5.0
Diffstat (limited to 'src/commands/bot')
| -rw-r--r-- | src/commands/bot/clientid.ts | 29 | ||||
| -rw-r--r-- | src/commands/bot/invite.ts | 20 | ||||
| -rw-r--r-- | src/commands/bot/memorystats.ts | 34 | ||||
| -rw-r--r-- | src/commands/bot/memoryusage.ts | 27 | ||||
| -rw-r--r-- | src/commands/bot/uptime.ts | 39 | ||||
| -rw-r--r-- | src/commands/bot/version.ts | 35 |
6 files changed, 184 insertions, 0 deletions
diff --git a/src/commands/bot/clientid.ts b/src/commands/bot/clientid.ts new file mode 100644 index 0000000..da7717e --- /dev/null +++ b/src/commands/bot/clientid.ts @@ -0,0 +1,29 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import emoji from 'emoji-random'; +import { MessageEmbed } from 'discord.js'; + +module.exports = class ClientIDBot extends Command { + constructor(client) { + super(client, { + name: 'clientid', + aliases: ['cid'], + group: 'bot', + 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/bot/invite.ts b/src/commands/bot/invite.ts new file mode 100644 index 0000000..8c798d1 --- /dev/null +++ b/src/commands/bot/invite.ts @@ -0,0 +1,20 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import emoji from 'emoji-random'; + +module.exports = class InviteBot extends Command { + constructor(client) { + super(client, { + name: 'invite', + aliases: ['inv'], + group: 'bot', + 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 ' + emoji.random()) + } +};
\ No newline at end of file diff --git a/src/commands/bot/memorystats.ts b/src/commands/bot/memorystats.ts new file mode 100644 index 0000000..669ac84 --- /dev/null +++ b/src/commands/bot/memorystats.ts @@ -0,0 +1,34 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; + +module.exports = class MemoryStatsBot extends Command { + constructor(client) { + super(client, { + name: 'memorystats', + aliases: [ + 'memstats', + 'mem-stats', + 'memory-stats', + 'memorystats', + 'memstat', + 'mem-stat', + 'memory-stat', + 'memorystat' + ], + group: 'bot', + 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/bot/memoryusage.ts b/src/commands/bot/memoryusage.ts new file mode 100644 index 0000000..545edd5 --- /dev/null +++ b/src/commands/bot/memoryusage.ts @@ -0,0 +1,27 @@ +import { Command, CommandoMessage } from 'discord.js-commando'; +import emoji from 'emoji-random'; + +module.exports = class MemoryUsageBot extends Command { + constructor(client) { + super(client, { + name: 'memoryusage', + aliases: [ + 'memusage', + 'mem-usage', + 'memory-usage', + 'mem', + 'memory', + 'memoryusage' + ], + group: 'bot', + 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/bot/uptime.ts b/src/commands/bot/uptime.ts new file mode 100644 index 0000000..3280d9e --- /dev/null +++ b/src/commands/bot/uptime.ts @@ -0,0 +1,39 @@ +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 UptimeBot extends Command { + constructor(client) { + super(client, { + name: 'uptime', + aliases: ['ut'], + group: 'bot', + 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/bot/version.ts b/src/commands/bot/version.ts new file mode 100644 index 0000000..7d2c71b --- /dev/null +++ b/src/commands/bot/version.ts @@ -0,0 +1,35 @@ +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 VersionBot extends Command { + constructor(client) { + super(client, { + name: 'version', + group: 'bot', + 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 |