diff options
| author | 8cy <[email protected]> | 2020-04-16 04:56:37 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-16 04:56:37 -0700 |
| commit | 8c435855e647ee7aef8578e253caf91fe44c67cc (patch) | |
| tree | ae0bb59de10ecec5ca2fc01dfa9190efd1f177ab /src/commands/utility | |
| parent | no longer hosting ws, v6.0.4 (diff) | |
| download | dep-core-8c435855e647ee7aef8578e253caf91fe44c67cc.tar.xz dep-core-8c435855e647ee7aef8578e253caf91fe44c67cc.zip | |
The Purification, v7.0.0
add:
- aesthetic, oddcase, stretch, surreal
- culturedtext
- dogeify
- howify
- insult
- lorem
- spongebob
Other Stuff:
- many refactoring
Diffstat (limited to 'src/commands/utility')
| -rw-r--r-- | src/commands/utility/btc.ts | 6 | ||||
| -rw-r--r-- | src/commands/utility/btcchange.ts (renamed from src/commands/utility/btcchange.js) | 7 | ||||
| -rw-r--r-- | src/commands/utility/clear.ts (renamed from src/commands/utility/clear.js) | 13 | ||||
| -rw-r--r-- | src/commands/utility/membercount.ts (renamed from src/commands/utility/membercount.js) | 6 | ||||
| -rw-r--r-- | src/commands/utility/server.ts (renamed from src/commands/utility/server.js) | 12 | ||||
| -rw-r--r-- | src/commands/utility/servercount.ts | 6 | ||||
| -rw-r--r-- | src/commands/utility/uptime.ts | 9 |
7 files changed, 32 insertions, 27 deletions
diff --git a/src/commands/utility/btc.ts b/src/commands/utility/btc.ts index 2845194..c0c14f3 100644 --- a/src/commands/utility/btc.ts +++ b/src/commands/utility/btc.ts @@ -1,4 +1,4 @@ -import { Command } from 'discord.js-commando'; +import { Command, CommandoMessage } from 'discord.js-commando'; import emoji from 'emoji-random'; import btc from 'btc-value'; btc.setApiKey('a43419ce-fc59-4951-8af9-20c5e36ef73f'); @@ -14,7 +14,7 @@ module.exports = class BTCUtility extends Command { args: [ { key: 'currencyName', - prompt: 'What currency could you like to see it in? (USD, AUD, CAD)', + prompt: 'What currency could you like to see it in? (USD, AUD, CAD, etc.)', type: 'string' } ], @@ -27,7 +27,7 @@ module.exports = class BTCUtility extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } - run(msg: Message, { currencyName }) { + run(msg: CommandoMessage, { currencyName }) { currencyName = currencyName.toUpperCase(); btc({ isDecimal: true, currencyCode: currencyName }).then(value => { msg.reply('The current price of *Bitcoin* in **' + currencyName + '** is **' + value + '**. ' + emoji.random()); diff --git a/src/commands/utility/btcchange.js b/src/commands/utility/btcchange.ts index 474a3ee..9ef5d4d 100644 --- a/src/commands/utility/btcchange.js +++ b/src/commands/utility/btcchange.ts @@ -1,5 +1,6 @@ -const { Command } = require('discord.js-commando'); -const btc = require('btc-value'); +import { Command, CommandoMessage } from 'discord.js-commando'; +import btc from 'btc-value'; +import emoji from 'emoji-random'; btc.setApiKey('a43419ce-fc59-4951-8af9-20c5e36ef73f'); module.exports = class BTCChangeUtility extends Command { @@ -27,7 +28,7 @@ module.exports = class BTCChangeUtility extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } - run(msg, { timeAmount }) { + run(msg: CommandoMessage, { timeAmount }) { if (timeAmount == 'day') { btc.getPercentageChangeLastDay().then(percentage => { msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random()); diff --git a/src/commands/utility/clear.js b/src/commands/utility/clear.ts index 6871cca..80e0c73 100644 --- a/src/commands/utility/clear.js +++ b/src/commands/utility/clear.ts @@ -1,5 +1,5 @@ -const { Command } = require('discord.js-commando'); -const emoji = require('emoji-random'); +import { Command, CommandoMessage } from 'discord.js-commando'; +import emoji from 'emoji-random'; module.exports = class ClearUtility extends Command { constructor(client) { @@ -28,22 +28,26 @@ module.exports = class ClearUtility extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'] }); } - async run(msg, { deleteAmount }) { + 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 }); }); } @@ -62,11 +66,12 @@ module.exports = class ClearUtility extends Command { 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 perms. ' + emoji.random()); + msg.reply('Insufficent permsissions. ' + emoji.random()); } } };
\ No newline at end of file diff --git a/src/commands/utility/membercount.js b/src/commands/utility/membercount.ts index 1178236..4d64f5d 100644 --- a/src/commands/utility/membercount.js +++ b/src/commands/utility/membercount.ts @@ -1,5 +1,5 @@ -const { Command } = require('discord.js-commando'); -const emoji = require('emoji-random'); +import { Command, CommandoMessage } from 'discord.js-commando'; +import emoji from 'emoji-random'; module.exports = class MemberCountUtility extends Command { constructor(client) { @@ -23,7 +23,7 @@ module.exports = class MemberCountUtility extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } - run(msg) { + 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/server.js b/src/commands/utility/server.ts index 58555fa..f5fddca 100644 --- a/src/commands/utility/server.js +++ b/src/commands/utility/server.ts @@ -1,5 +1,5 @@ -const { Command } = require('discord.js-commando'); -const { MessageEmbed } = require('discord.js'); +import { Command, CommandoMessage } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; module.exports = class ServerUtility extends Command { constructor(client) { @@ -32,7 +32,7 @@ module.exports = class ServerUtility extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } - run(msg) { + run(msg: CommandoMessage) { var o = msg.guild.members.cache.filter(m => m.presence.status === 'online').size; let embed = new MessageEmbed() @@ -43,10 +43,10 @@ module.exports = class ServerUtility extends Command { .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.filter(c => c.type === 'text').size}`, true) - .addField('Voice channels', `${msg.guild.channels.filter(c => c.type === 'voice').size}`, 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.get('699473263998271489').joinedAt}`) + .addField(`${this.client.user.username} joined`, `${msg.guild.members.cache.get('699473263998271489').joinedAt}`) .setColor(0xFFCC4D); msg.channel.send(embed); diff --git a/src/commands/utility/servercount.ts b/src/commands/utility/servercount.ts index 7e92247..b3ce320 100644 --- a/src/commands/utility/servercount.ts +++ b/src/commands/utility/servercount.ts @@ -1,5 +1,5 @@ -import { Command } from 'discord.js-commando'; -import { MessageEmbed, Message } from 'discord.js'; +import { Command, CommandoMessage } from 'discord.js-commando'; +import { MessageEmbed } from 'discord.js'; import emoji from 'emoji-random'; module.exports = class ServerCountUtility extends Command { @@ -14,7 +14,7 @@ module.exports = class ServerCountUtility extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } - run(msg: Message) { + run(msg: CommandoMessage) { msg.channel.send('Please wait...').then(m => { m.edit(`** **`); diff --git a/src/commands/utility/uptime.ts b/src/commands/utility/uptime.ts index 1bea003..dcce606 100644 --- a/src/commands/utility/uptime.ts +++ b/src/commands/utility/uptime.ts @@ -1,9 +1,8 @@ -import { Command } from 'discord.js-commando'; +import { Command, CommandoMessage } from 'discord.js-commando'; import { duration as _duration } from 'moment'; import 'moment-duration-format'; -// @ts-ignore import emoji from 'emoji-random'; -import { MessageEmbed, Message } from 'discord.js'; +import { MessageEmbed } from 'discord.js'; export default class UptimeUtility extends Command { constructor(client) { @@ -25,13 +24,13 @@ export default class UptimeUtility extends Command { clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } - run(msg: Message) { + 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('uwufier has been up for ' + duration + '. ' + emoji.random()) + .setDescription('<@699473263998271489> has been up for ' + duration + '. ' + emoji.random()) .setColor(0xFFCC4D) msg.channel.send(emb); |