summaryrefslogtreecommitdiff
path: root/server/src/commands/mod
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/commands/mod')
-rw-r--r--server/src/commands/mod/Ban.ts2
-rw-r--r--server/src/commands/mod/Kick.ts2
-rw-r--r--server/src/commands/mod/Prune.ts17
-rw-r--r--server/src/commands/mod/Slowmode.ts12
4 files changed, 24 insertions, 9 deletions
diff --git a/server/src/commands/mod/Ban.ts b/server/src/commands/mod/Ban.ts
index d91731e..3e81bfb 100644
--- a/server/src/commands/mod/Ban.ts
+++ b/server/src/commands/mod/Ban.ts
@@ -24,7 +24,7 @@ export default class BanMod extends Command {
type: 'string',
prompt: {
start: 'Which user would you like to ban?',
- retry: 'That doesn\' seem to be a user, please try again!'
+ retry: 'That doesn\'t seem to be a user, please try again!'
}
},
{
diff --git a/server/src/commands/mod/Kick.ts b/server/src/commands/mod/Kick.ts
index 3295c2a..da1a91f 100644
--- a/server/src/commands/mod/Kick.ts
+++ b/server/src/commands/mod/Kick.ts
@@ -24,7 +24,7 @@ export default class KickMod extends Command {
type: 'string',
prompt: {
start: 'Which user would you like to kick?',
- retry: 'That doesn\' seem to be a user, please try again!'
+ retry: 'That doesn\'t seem to be a user, please try again!'
}
},
{
diff --git a/server/src/commands/mod/Prune.ts b/server/src/commands/mod/Prune.ts
index bf56846..55307bc 100644
--- a/server/src/commands/mod/Prune.ts
+++ b/server/src/commands/mod/Prune.ts
@@ -31,9 +31,20 @@ export default class PruneMod extends Command {
}
public exec(msg: Message, { amount }): Promise<Message> {
- if (amount <= 100) amount = 99;
+ msg.delete();
+ let limit = false;
+ if (amount >= 100){
+ amount = 99;
+ limit = true;
+ }
(msg.channel as TextChannel).bulkDelete(amount, true);
- return msg.reply('Due to Discord API limitations, the amount of messages you have specified has been rounded down to **99**. (This message will automatically be deleted in 3 seconds.)')
- .then(m => m.delete({ timeout: 3000 }));
+ if (limit) {
+ msg.reply('Due to Discord API limitations, the amount of messages you have specified has been rounded down to **99**. (This message will automatically be deleted in 3 seconds.)')
+ .then(m => m.delete({ timeout: 3000 }));
+ }
+ if (amount > 1)
+ return msg.reply(`**${amount}** messages have been successfully pruned!`);
+ else
+ return msg.reply(`**${amount}** message has been successfully pruned!`);
}
} \ No newline at end of file
diff --git a/server/src/commands/mod/Slowmode.ts b/server/src/commands/mod/Slowmode.ts
index 1d626ec..3aec2bd 100644
--- a/server/src/commands/mod/Slowmode.ts
+++ b/server/src/commands/mod/Slowmode.ts
@@ -1,5 +1,6 @@
import { Command } from 'discord-akairo';
import { Message } from 'discord.js';
+import { TextChannel } from 'discord.js';
export default class SlowmodeMod extends Command {
public constructor() {
@@ -39,15 +40,18 @@ export default class SlowmodeMod extends Command {
public exec(msg: Message, { amount, realtime }): Promise<Message> {
try {
- if (amount > 120) return msg.channel.send('Due to Discord API limitations, slow mode can only be a max of **120** seconds or less!');
-
- // msg.channel.setRateLimitPerUser(amount);
+ if (amount > 120) {
+ amount = 120;
+ msg.channel.send('Due to Discord API limitations, slow mode can only be a max of **120** seconds or less! Your specified amount has been rounded down to **120** seconds. (This message will automatically be deleted in 3 seconds.)')
+ .then(m => m.delete({ timeout: 3000 }));
+ }
+ (msg.channel as TextChannel).setRateLimitPerUser(amount);
if (realtime) {
let time = 60000 * realtime;
msg.channel.send(`Slowmode has now been set to ${amount} seconds and will end in ${realtime} minutes!`);
setTimeout(() => {
- // msg.channel.setRateLimitPerUser(0);
+ (msg.channel as TextChannel).setRateLimitPerUser(0);
return msg.channel.send('Slowmode has now been disabled!');
}, time);
} else {