aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/info/botInfo.ts2
-rw-r--r--src/commands/moderation/ban.ts5
-rw-r--r--src/commands/moderation/kick.ts3
-rw-r--r--src/commands/moderation/modlog.ts2
-rw-r--r--src/commands/moderation/mute.ts3
-rw-r--r--src/commands/moderation/unmute.ts3
-rw-r--r--src/commands/moderation/warn.ts3
7 files changed, 12 insertions, 9 deletions
diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts
index 8f85fe6..257dc90 100644
--- a/src/commands/info/botInfo.ts
+++ b/src/commands/info/botInfo.ts
@@ -53,7 +53,7 @@ export default class BotInfoCommand extends BushCommand {
)
.addField('**CPU Usage**', `${client.stats.cpu}%`, true)
.addField('**Platform**', Platform[process.platform], true)
- .addField('**Commands Used**', `${client.stats.commandsUsed}`, true)
+ .addField('**Commands Used**', `${client.stats.commandsUsed.toLocaleString()}`, true)
.addField('**Servers**', client.guilds.cache.size.toLocaleString(), true)
.addField('**Users**', client.users.cache.size.toLocaleString(), true)
.addField('**Discord.js Version**', discordJSVersion, true)
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts
index b64330f..4c2b3d3 100644
--- a/src/commands/moderation/ban.ts
+++ b/src/commands/moderation/ban.ts
@@ -1,5 +1,6 @@
import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib';
import { Snowflake, User } from 'discord.js';
+import { Moderation } from '../../lib/common/moderation';
export default class BanCommand extends BushCommand {
public constructor() {
@@ -103,9 +104,7 @@ export default class BanCommand extends BushCommand {
const useForce = force && message.author.isOwner();
if (!message.member) throw new Error(`message.member is null`);
- const canModerateResponse = member
- ? await util.moderationPermissionCheck(message.member, member, 'ban', true, useForce)
- : true;
+ const canModerateResponse = member ? await Moderation.permissionCheck(message.member, member, 'ban', true, useForce) : true;
if (canModerateResponse !== true) {
return await message.util.reply(canModerateResponse);
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts
index 07c25ab..715483a 100644
--- a/src/commands/moderation/kick.ts
+++ b/src/commands/moderation/kick.ts
@@ -1,4 +1,5 @@
import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushSlashMessage, BushUser } from '@lib';
+import { Moderation } from '../../lib/common/moderation';
export default class KickCommand extends BushCommand {
public constructor() {
@@ -67,7 +68,7 @@ export default class KickCommand extends BushCommand {
);
if (!message.member) throw new Error(`message.member is null`);
const useForce = force && message.author.isOwner();
- const canModerateResponse = await util.moderationPermissionCheck(message.member, member, 'kick', true, useForce);
+ const canModerateResponse = await Moderation.permissionCheck(message.member, member, 'kick', true, useForce);
if (canModerateResponse !== true) {
return message.util.reply(canModerateResponse);
diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts
index 0eb7392..d5c6f91 100644
--- a/src/commands/moderation/modlog.ts
+++ b/src/commands/moderation/modlog.ts
@@ -48,7 +48,7 @@ export default class ModlogCommand extends BushCommand {
#generateModlogInfo(log: ModLog, showUser: boolean): string {
const trim = (str: string): string => (str.endsWith('\n') ? str.substring(0, str.length - 1).trim() : str.trim());
- const modLog = [`**Case ID**: ${log.id}`, `**Type**: ${log.type.toLowerCase()}`];
+ const modLog = [`**Case ID**: ${util.discord.escapeItalic(log.id)}`, `**Type**: ${log.type.toLowerCase()}`];
if (showUser) modLog.push(`**User**: <@!${log.user}>`);
modLog.push(`**Moderator**: <@!${log.moderator}>`);
if (log.duration) modLog.push(`**Duration**: ${util.humanizeDuration(log.duration)}`);
diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts
index 9e68d63..942c0b0 100644
--- a/src/commands/moderation/mute.ts
+++ b/src/commands/moderation/mute.ts
@@ -1,4 +1,5 @@
import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser } from '@lib';
+import { Moderation } from '../../lib/common/moderation';
export default class MuteCommand extends BushCommand {
public constructor() {
@@ -73,7 +74,7 @@ export default class MuteCommand extends BushCommand {
if (!message.member) throw new Error(`message.member is null`);
const useForce = force && message.author.isOwner();
- const canModerateResponse = await util.moderationPermissionCheck(message.member, member, 'mute', true, useForce);
+ const canModerateResponse = await Moderation.permissionCheck(message.member, member, 'mute', true, useForce);
const victimBoldTag = `**${member.user.tag}**`;
if (canModerateResponse !== true) {
diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts
index 680c7ba..3d592b7 100644
--- a/src/commands/moderation/unmute.ts
+++ b/src/commands/moderation/unmute.ts
@@ -1,4 +1,5 @@
import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushSlashMessage, BushUser } from '@lib';
+import { Moderation } from '../../lib/common/moderation';
export default class UnmuteCommand extends BushCommand {
public constructor() {
@@ -67,7 +68,7 @@ export default class UnmuteCommand extends BushCommand {
const useForce = force && message.author.isOwner();
- const canModerateResponse = await util.moderationPermissionCheck(message.member, member, 'unmute', true, useForce);
+ const canModerateResponse = await Moderation.permissionCheck(message.member, member, 'unmute', true, useForce);
const victimBoldTag = `**${member.user.tag}**`;
diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts
index b4bf74d..3df4b3b 100644
--- a/src/commands/moderation/warn.ts
+++ b/src/commands/moderation/warn.ts
@@ -1,4 +1,5 @@
import { BushCommand, BushGuildMember, BushMessage, BushSlashMessage, BushUser } from '@lib';
+import { Moderation } from '../../lib/common/moderation';
export default class WarnCommand extends BushCommand {
public constructor() {
@@ -63,7 +64,7 @@ export default class WarnCommand extends BushCommand {
if (!member) return message.util.reply(`${util.emojis.error} I cannot warn users that are not in the server.`);
const useForce = force && message.author.isOwner();
if (!message.member) throw new Error(`message.member is null`);
- const canModerateResponse = await util.moderationPermissionCheck(message.member, member, 'warn', true, useForce);
+ const canModerateResponse = await Moderation.permissionCheck(message.member, member, 'warn', true, useForce);
const victimBoldTag = `**${member.user.tag}**`;
if (canModerateResponse !== true) {