aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arguments/permission.ts2
-rw-r--r--src/arguments/roleWithDuation.ts6
-rw-r--r--src/commands/config/blacklist.ts3
-rw-r--r--src/commands/config/config.ts12
-rw-r--r--src/commands/dev/test.ts22
-rw-r--r--src/commands/info/guildInfo.ts98
-rw-r--r--src/commands/info/help.ts15
-rw-r--r--src/commands/info/links.ts2
-rw-r--r--src/commands/info/snowflake.ts2
-rw-r--r--src/commands/info/userInfo.ts3
-rw-r--r--src/commands/leveling/leaderboard.ts8
-rw-r--r--src/commands/leveling/level.ts8
-rw-r--r--src/commands/leveling/setLevel.ts2
-rw-r--r--src/commands/leveling/setXp.ts2
-rw-r--r--src/commands/moderation/ban.ts18
-rw-r--r--src/commands/moderation/hideCase.ts6
-rw-r--r--src/commands/moderation/kick.ts11
-rw-r--r--src/commands/moderation/modlog.ts2
-rw-r--r--src/commands/moderation/mute.ts61
-rw-r--r--src/commands/moderation/role.ts23
-rw-r--r--src/commands/moderation/slowmode.ts2
-rw-r--r--src/commands/moderation/unban.ts13
-rw-r--r--src/commands/moderation/unmute.ts28
-rw-r--r--src/commands/moderation/warn.ts31
-rw-r--r--src/commands/moulberry-bush/capePerms.ts8
-rw-r--r--src/commands/moulberry-bush/serverStatus.ts2
-rw-r--r--src/commands/utilities/activity.ts2
-rw-r--r--src/commands/utilities/price.ts2
-rw-r--r--src/lib/common/ButtonPaginator.ts9
-rw-r--r--src/lib/common/util/Arg.ts7
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts13
-rw-r--r--src/lib/utils/BushConstants.ts6
-rw-r--r--src/listeners/custom/bushBan.ts3
-rw-r--r--src/listeners/custom/bushKick.ts3
-rw-r--r--src/listeners/custom/bushLevelUpdate.ts3
-rw-r--r--src/listeners/custom/bushMute.ts3
-rw-r--r--src/listeners/custom/bushPunishRole.ts3
-rw-r--r--src/listeners/custom/bushPunishRoleRemove.ts3
-rw-r--r--src/listeners/custom/bushUnban.ts3
-rw-r--r--src/listeners/custom/bushUnmute.ts3
-rw-r--r--src/listeners/custom/bushWarn.ts3
41 files changed, 198 insertions, 258 deletions
diff --git a/src/arguments/permission.ts b/src/arguments/permission.ts
index 8ad0102..3275c49 100644
--- a/src/arguments/permission.ts
+++ b/src/arguments/permission.ts
@@ -4,7 +4,7 @@ import { BushArgumentTypeCaster } from '../lib/extensions/discord-akairo/BushArg
export const permissionTypeCaster: BushArgumentTypeCaster = (_, phrase) => {
if (!phrase) return null;
phrase = phrase.toUpperCase().replace(/ /g, '_');
- if (!Permissions.FLAGS[phrase as keyof typeof Permissions.FLAGS]) {
+ if (!Reflect.has(Permissions.FLAGS, phrase)) {
return null;
} else {
return phrase;
diff --git a/src/arguments/roleWithDuation.ts b/src/arguments/roleWithDuation.ts
index a63026d..50f54e2 100644
--- a/src/arguments/roleWithDuation.ts
+++ b/src/arguments/roleWithDuation.ts
@@ -8,9 +8,7 @@ export const roleWithDurationTypeCaster: BushArgumentTypeCaster = async (
let { duration, contentWithoutTime } = client.util.parseDuration(phrase);
if (contentWithoutTime === null || contentWithoutTime === undefined) return null;
contentWithoutTime = contentWithoutTime.trim();
- const role = await util.arg.cast('role', client.commandHandler.resolver, message, contentWithoutTime);
- if (!role) {
- return null;
- }
+ const role = await util.arg.cast('role', message, contentWithoutTime);
+ if (!role) return null;
return { duration, role };
};
diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts
index 9f3737d..8a575c3 100644
--- a/src/commands/config/blacklist.ts
+++ b/src/commands/config/blacklist.ts
@@ -68,8 +68,7 @@ export default class BlacklistCommand extends BushCommand {
const global = args.global && message.author.isOwner();
const target =
typeof args.target === 'string'
- ? (await util.arg.cast('channel', client.commandHandler.resolver, message as BushMessage, args.target)) ??
- (await util.arg.cast('user', client.commandHandler.resolver, message as BushMessage, args.target))
+ ? (await util.arg.cast('channel', message, args.target)) ?? (await util.arg.cast('user', message, args.target))
: args.target;
if (!target) return await message.util.reply(`${util.emojis.error} Choose a valid channel or user.`);
const targetID = target.id;
diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts
index 72ba566..83bcebe 100644
--- a/src/commands/config/config.ts
+++ b/src/commands/config/config.ts
@@ -336,15 +336,9 @@ export default class SettingsCommand extends BushCommand {
);
settingsEmbed.setFooter(
- `Run "${
- message.util.isSlash
- ? '/'
- : client.config.isDevelopment
- ? 'dev '
- : message.util.parsed?.prefix ?? client.config.prefix
- }${message.util.parsed?.alias ?? 'config'} ${message.util.isSlash ? _.snakeCase(setting) : setting} ${
- guildSettingsObj[setting].type.includes('-array') ? 'add/remove' : 'set'
- } <value>" to set this setting.`
+ `Run "${util.prefix(message)}${message.util.parsed?.alias ?? 'config'} ${
+ message.util.isSlash ? _.snakeCase(setting) : setting
+ } ${guildSettingsObj[setting].type.includes('-array') ? 'add/remove' : 'set'} <value>" to set this setting.`
);
settingsEmbed.addField('value', (await generateCurrentValue(guildSettingsObj[setting].type)) || '[No Value Set]');
return { embeds: [settingsEmbed], components: [components] };
diff --git a/src/commands/dev/test.ts b/src/commands/dev/test.ts
index a1e5052..38ea920 100644
--- a/src/commands/dev/test.ts
+++ b/src/commands/dev/test.ts
@@ -107,19 +107,19 @@ export default class TestCommand extends BushCommand {
fields.push({ name: `Field ${i}`, value: `Field Value ${i}` });
}
const c = util.colors;
- const o = { description, author, footer, fields }!;
+ const o = { description, author, footer, fields, time: Date.now() };
const embeds = [
- new MessageEmbed({ ...o, ...{ title: 'Embed Title 0', color: c.red } }).setTimestamp(),
- new MessageEmbed({ ...o, ...{ title: 'Embed Title 1', color: c.orange } }).setTimestamp(),
- new MessageEmbed({ ...o, ...{ title: 'Embed Title 2', color: c.gold } }).setTimestamp(),
- new MessageEmbed({ ...o, ...{ title: 'Embed Title 3', color: c.yellow } }).setTimestamp(),
- new MessageEmbed({ ...o, ...{ title: 'Embed Title 4', color: c.green } }).setTimestamp(),
- new MessageEmbed({ ...o, ...{ title: 'Embed Title 5', color: c.darkGreen } }).setTimestamp(),
- new MessageEmbed({ ...o, ...{ title: 'Embed Title 6', color: c.aqua } }).setTimestamp(),
- new MessageEmbed({ ...o, ...{ title: 'Embed Title 7', color: c.blue } }).setTimestamp(),
- new MessageEmbed({ ...o, ...{ title: 'Embed Title 8', color: c.purple } }).setTimestamp(),
- new MessageEmbed({ ...o, ...{ title: 'Embed Title 9', color: c.pink } }).setTimestamp()
+ { ...o, title: 'Embed Title 0', color: c.red },
+ { ...o, title: 'Embed Title 1', color: c.orange },
+ { ...o, title: 'Embed Title 2', color: c.gold },
+ { ...o, title: 'Embed Title 3', color: c.yellow },
+ { ...o, title: 'Embed Title 4', color: c.green },
+ { ...o, title: 'Embed Title 5', color: c.darkGreen },
+ { ...o, title: 'Embed Title 6', color: c.aqua },
+ { ...o, title: 'Embed Title 7', color: c.blue },
+ { ...o, title: 'Embed Title 8', color: c.purple },
+ { ...o, title: 'Embed Title 9', color: c.pink }
];
const ButtonRows: MessageActionRow[] = [];
diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts
index 4a79918..44c388d 100644
--- a/src/commands/info/guildInfo.ts
+++ b/src/commands/info/guildInfo.ts
@@ -45,6 +45,7 @@ export default class GuildInfoCommand extends BushCommand {
`${util.emojis.error} You must either provide an server to provide info about or run this command in a server.`
);
}
+ const otherEmojis = client.consts.mappings.otherEmojis;
let isPreview = false;
if (['number', 'string'].includes(typeof args?.guild)) {
const preview = await client.fetchGuildPreview(`${args.guild}` as Snowflake).catch(() => {});
@@ -61,47 +62,27 @@ export default class GuildInfoCommand extends BushCommand {
const guildStats: string[] = [];
const guildSecurity: string[] = [];
const verifiedGuilds = Object.values(client.consts.mappings.guilds);
- if (verifiedGuilds.includes(guild.id)) emojis.push(client.consts.mappings.otherEmojis.BUSH_VERIFIED);
+ if (verifiedGuilds.includes(guild.id)) emojis.push(otherEmojis.BUSH_VERIFIED);
if (!isPreview && guild instanceof Guild) {
- if (guild.premiumTier)
- emojis.push(
- client.consts.mappings.otherEmojis[`BOOST_${guild.premiumTier}` as keyof typeof client.consts.mappings.otherEmojis]
- );
+ if (guild.premiumTier !== 'NONE') emojis.push(otherEmojis[`BOOST_${guild.premiumTier}`]);
await guild.fetch();
+ const channels = guild.channels.cache;
const channelTypes = [
- `${client.consts.mappings.otherEmojis.TEXT} ${guild.channels.cache
- .filter((channel) => channel.type === 'GUILD_TEXT')
- .size.toLocaleString()}`,
- `${client.consts.mappings.otherEmojis.NEWS} ${guild.channels.cache
- .filter((channel) => channel.type === 'GUILD_NEWS')
- .size.toLocaleString()}`,
- `${client.consts.mappings.otherEmojis.VOICE} ${guild.channels.cache
- .filter((channel) => channel.type === 'GUILD_VOICE')
- .size.toLocaleString()}`,
- `${client.consts.mappings.otherEmojis.STAGE} ${guild.channels.cache
- .filter((channel) => channel.type === 'GUILD_STAGE_VOICE')
- .size.toLocaleString()}`,
- `${client.consts.mappings.otherEmojis.STORE} ${guild.channels.cache
- .filter((channel) => channel.type === 'GUILD_STORE')
- .size.toLocaleString()}`,
- `${client.consts.mappings.otherEmojis.CATEGORY} ${guild.channels.cache
- .filter((channel) => channel.type === 'GUILD_CATEGORY')
- .size.toLocaleString()}`,
- `${client.consts.mappings.otherEmojis.THREAD} ${guild.channels.cache
- .filter((channel) =>
- ['GUILD_NEWS_THREAD', 'GUILD_PUBLIC_THREAD', 'GUILD_PRIVATE_THREAD', 'GUILD_STAGE_VOICE'].includes(channel.type)
- )
- .size.toLocaleString()}`
+ `${otherEmojis.TEXT} ${channels.filter((channel) => channel.type === 'GUILD_TEXT').size.toLocaleString()}`,
+ `${otherEmojis.NEWS} ${channels.filter((channel) => channel.type === 'GUILD_NEWS').size.toLocaleString()}`,
+ `${otherEmojis.VOICE} ${channels.filter((channel) => channel.type === 'GUILD_VOICE').size.toLocaleString()}`,
+ `${otherEmojis.STAGE} ${channels.filter((channel) => channel.type === 'GUILD_STAGE_VOICE').size.toLocaleString()}`,
+ `${otherEmojis.STORE} ${channels.filter((channel) => channel.type === 'GUILD_STORE').size.toLocaleString()}`,
+ `${otherEmojis.CATEGORY} ${channels.filter((channel) => channel.type === 'GUILD_CATEGORY').size.toLocaleString()}`,
+ `${otherEmojis.THREAD} ${channels.filter((channel) => channel.type.includes('_THREAD')).size.toLocaleString()}`
];
- const guildRegions: string[] = [];
- guild.channels.cache.forEach((channel) => {
- if (!channel.type.includes('VOICE')) return;
- else if (!guildRegions.includes((channel as BaseGuildVoiceChannel).rtcRegion ?? 'automatic')) {
- guildRegions.push((channel as BaseGuildVoiceChannel).rtcRegion ?? 'automatic');
- }
- });
+ const guildRegions = [
+ ...new Set(
+ guild.channels.cache.filter((c) => c.isVoice()).map((c) => (c as BaseGuildVoiceChannel).rtcRegion ?? 'automatic')
+ )
+ ] as RTCRegion[];
guildAbout.push(
`**Owner:** ${guild.members.cache.get(guild.ownerId)?.user.tag}`,
@@ -109,9 +90,7 @@ export default class GuildInfoCommand extends BushCommand {
`**Members:** ${guild.memberCount.toLocaleString() ?? 0} (${util.emojis.onlineCircle} ${
guild.approximatePresenceCount?.toLocaleString() ?? 0
}, ${util.emojis.offlineCircle} ${(guild.memberCount - (guild.approximatePresenceCount ?? 0)).toLocaleString() ?? 0})`,
- `**Regions:** ${guildRegions
- .map((region) => client.consts.mappings.regions[region as keyof typeof client.consts.mappings.regions] || region)
- .join(', ')}`
+ `**Regions:** ${guildRegions.map((region) => client.consts.mappings.regions[region] || region).join(', ')}`
);
if (guild.premiumSubscriptionCount)
guildAbout.push(
@@ -171,28 +150,21 @@ export default class GuildInfoCommand extends BushCommand {
);
}
+ const features = client.consts.mappings.features;
const guildFeatures = guild.features.sort((a, b): number => {
- const aWeight = client.consts.mappings.features[a]?.weight;
- const bWeight = client.consts.mappings.features[b]?.weight;
+ const aWeight = features[a]?.weight;
+ const bWeight = features[b]?.weight;
- if (aWeight != undefined && bWeight != undefined) {
- return aWeight - bWeight;
- } else if (aWeight == undefined) {
- return 1;
- } else if (bWeight == undefined) {
- return -1;
- }
+ if (aWeight !== undefined && bWeight !== undefined) return aWeight - bWeight;
+ else if (aWeight == undefined) return 1;
+ else if (bWeight == undefined) return -1;
return 0;
});
if (guildFeatures.length) {
guildFeatures.forEach((feature) => {
- if (client.consts.mappings.features[feature]?.emoji) {
- emojis.push(`${client.consts.mappings.features[feature].emoji}`);
- } else if (client.consts.mappings.features[feature]?.name) {
- emojis.push(`\`${client.consts.mappings.features[feature].name}\``);
- } else {
- emojis.push(`\`${feature}\``);
- }
+ if (features[feature]?.emoji) emojis.push(`${features[feature].emoji}`);
+ else if (features[feature]?.name) emojis.push(`\`${features[feature].name}\``);
+ else emojis.push(`\`${feature}\``);
});
}
@@ -204,7 +176,7 @@ export default class GuildInfoCommand extends BushCommand {
.setTitle(guild.name)
.setColor(util.colors.default)
.addField('» About', guildAbout.join('\n'));
- if (guildStats) guildInfoEmbed.addField('» Stats', guildStats.join('\n'));
+ if (guildStats.length) guildInfoEmbed.addField('» Stats', guildStats.join('\n'));
const guildIcon = guild.iconURL({ size: 2048, format: 'png', dynamic: true });
if (guildIcon) {
guildInfoEmbed.setThumbnail(guildIcon);
@@ -218,3 +190,19 @@ export default class GuildInfoCommand extends BushCommand {
return await message.util.reply({ embeds: [guildInfoEmbed] });
}
}
+
+type RTCRegion =
+ | 'us-west'
+ | 'us-east'
+ | 'us-central'
+ | 'us-south'
+ | 'singapore'
+ | 'southafrica'
+ | 'sydney'
+ | 'europe'
+ | 'brazil'
+ | 'hongkong'
+ | 'russia'
+ | 'japan'
+ | 'india'
+ | 'automatic';
diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts
index 5e80199..440bcb2 100644
--- a/src/commands/info/help.ts
+++ b/src/commands/info/help.ts
@@ -22,11 +22,7 @@ export default class HelpCommand extends BushCommand {
optional: true
}
},
- {
- id: 'showHidden',
- match: 'flag',
- flag: '--hidden'
- }
+ { id: 'showHidden', match: 'flag', flag: '--hidden' }
],
slash: true,
slashOptions: [
@@ -46,11 +42,7 @@ export default class HelpCommand extends BushCommand {
message: BushMessage | BushSlashMessage,
args: { command: BushCommand | string; showHidden?: boolean }
): Promise<unknown> {
- const prefix = message.util.isSlash
- ? '/'
- : client.config.isDevelopment
- ? 'dev '
- : message.util.parsed?.prefix ?? client.config.prefix;
+ const prefix = util.prefix(message);
const row = new MessageActionRow();
if (!client.config.isDevelopment && !client.guilds.cache.some((guild) => guild.ownerId === message.author.id)) {
@@ -101,8 +93,7 @@ export default class HelpCommand extends BushCommand {
if (command.superUserOnly && !isSuperUser) {
return false;
}
- // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
- return !(command.restrictedGuilds?.includes(message.guild?.id!) === false && !args.showHidden);
+ return !(command.restrictedGuilds?.includes(message.guild?.id ?? '') === false && !args.showHidden);
});
const categoryNice = category.id
.replace(/(\b\w)/gi, (lc): string => lc.toUpperCase())
diff --git a/src/commands/info/links.ts b/src/commands/info/links.ts
index 569b959..754b22b 100644
--- a/src/commands/info/links.ts
+++ b/src/commands/info/links.ts
@@ -12,8 +12,6 @@ export default class LinksCommand extends BushCommand {
usage: 'links',
examples: ['links']
},
- ratelimit: 4,
- cooldown: 4000,
clientPermissions: (m) => util.clientSendAndPermCheck(m),
userPermissions: [],
slash: true
diff --git a/src/commands/info/snowflake.ts b/src/commands/info/snowflake.ts
index 81b3f9d..083acbf 100644
--- a/src/commands/info/snowflake.ts
+++ b/src/commands/info/snowflake.ts
@@ -22,8 +22,6 @@ export default class SnowflakeCommand extends BushCommand {
super('snowflake', {
aliases: ['snowflake', 'info', 'sf'],
category: 'info',
- ratelimit: 4,
- cooldown: 4000,
description: {
content: 'Provides information about the specified Snowflake.',
usage: 'snowflake <snowflake>',
diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts
index 353d844..17be687 100644
--- a/src/commands/info/userInfo.ts
+++ b/src/commands/info/userInfo.ts
@@ -20,8 +20,7 @@ export default class UserInfoCommand extends BushCommand {
start: 'What user would you like to find information about?',
retry: '{error} Choose a valid user to find information about.',
optional: true
- },
- default: null
+ }
}
],
slash: true,
diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts
index e3344a0..dde2270 100644
--- a/src/commands/leveling/leaderboard.ts
+++ b/src/commands/leveling/leaderboard.ts
@@ -44,13 +44,7 @@ export default class LeaderboardCommand extends BushCommand {
return await message.util.reply(
`${util.emojis.error} This command can only be run in servers with the leveling feature enabled.${
message.member?.permissions.has('MANAGE_GUILD')
- ? ` You can toggle features using the \`${
- message.util.isSlash
- ? '/'
- : client.config.isDevelopment
- ? 'dev '
- : message.util.parsed?.prefix ?? client.config.prefix
- }features\` command.`
+ ? ` You can toggle features using the \`${util.prefix(message)}features\` command.`
: ''
}`
);
diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts
index 4d7adb3..219aab1 100644
--- a/src/commands/leveling/level.ts
+++ b/src/commands/leveling/level.ts
@@ -56,13 +56,7 @@ export default class LevelCommand extends BushCommand {
return await message.util.reply(
`${util.emojis.error} This command can only be run in servers with the leveling feature enabled.${
message.member?.permissions.has('MANAGE_GUILD')
- ? ` You can toggle features using the \`${
- message.util.isSlash
- ? '/'
- : client.config.isDevelopment
- ? 'dev '
- : message.util.parsed?.prefix ?? client.config.prefix
- }features\` command.`
+ ? ` You can toggle features using the \`${util.prefix(message)}features\` command.`
: ''
}`
);
diff --git a/src/commands/leveling/setLevel.ts b/src/commands/leveling/setLevel.ts
index 9a7337a..d3ee162 100644
--- a/src/commands/leveling/setLevel.ts
+++ b/src/commands/leveling/setLevel.ts
@@ -55,8 +55,6 @@ export default class SetLevelCommand extends BushCommand {
{ user, level }: { user: User; level: number }
): Promise<unknown> {
if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a guild.`);
- if (message.author.id === '496409778822709251')
- return await message.util.reply(`${util.emojis.error} This command is Bestower proof.`);
if (!user.id) throw new Error('user.id is null');
if (isNaN(level))
diff --git a/src/commands/leveling/setXp.ts b/src/commands/leveling/setXp.ts
index a73ae58..a140bfc 100644
--- a/src/commands/leveling/setXp.ts
+++ b/src/commands/leveling/setXp.ts
@@ -58,8 +58,6 @@ export default class SetXpCommand extends BushCommand {
{ user, xp }: { user: User; xp: number }
): Promise<unknown> {
if (!message.guild) return await message.util.reply(`${util.emojis.error} This command can only be run in a guild.`);
- if (message.author.id === '496409778822709251')
- return await message.util.reply(`${util.emojis.error} This command is Bestower proof.`);
if (!user.id) throw new Error('user.id is null');
if (isNaN(xp)) return await message.util.reply(`${util.emojis.error} Provide a valid number.`);
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts
index b3d97d2..74b1b54 100644
--- a/src/commands/moderation/ban.ts
+++ b/src/commands/moderation/ban.ts
@@ -118,10 +118,7 @@ export default class BanCommand extends BushCommand {
let time: number;
if (reason) {
- time =
- typeof reason === 'string'
- ? await util.arg.cast('duration', client.commandHandler.resolver, message as BushMessage, reason)
- : reason.duration;
+ time = typeof reason === 'string' ? await util.arg.cast('duration', message, reason) : reason.duration;
}
const parsedReason = reason?.contentWithoutTime ?? null;
@@ -141,19 +138,20 @@ export default class BanCommand extends BushCommand {
});
const responseMessage = () => {
+ const victim = util.format.bold(user.tag);
switch (responseCode) {
case 'missing permissions':
- return `${util.emojis.error} Could not ban **${user.tag}** because I do not have permissions`;
+ return `${util.emojis.error} Could not ban ${victim} because I am missing the **Ban Members** permission.`;
case 'error banning':
- return `${util.emojis.error} An error occurred while trying to ban **${user.tag}**.`;
+ return `${util.emojis.error} An error occurred while trying to ban ${victim}.`;
case 'error creating ban entry':
- return `${util.emojis.error} While banning **${user.tag}**, there was an error creating a ban entry, please report this to my developers.`;
+ return `${util.emojis.error} While banning ${victim}, there was an error creating a ban entry, please report this to my developers.`;
case 'error creating modlog entry':
- return `${util.emojis.error} While banning **${user.tag}**, there was an error creating a modlog entry, please report this to my developers.`;
+ return `${util.emojis.error} While banning ${victim}, there was an error creating a modlog entry, please report this to my developers.`;
case 'failed to dm':
- return `${util.emojis.warn} Banned **${user.tag}** however I could not send them a dm.`;
+ return `${util.emojis.warn} Banned ${victim} however I could not send them a dm.`;
case 'success':
- return `${util.emojis.success} Successfully banned **${user.tag}**.`;
+ return `${util.emojis.success} Successfully banned ${victim}.`;
}
};
return await message.util.reply({ content: responseMessage(), allowedMentions: AllowedMentions.none() });
diff --git a/src/commands/moderation/hideCase.ts b/src/commands/moderation/hideCase.ts
index 38cfe31..981a8bc 100644
--- a/src/commands/moderation/hideCase.ts
+++ b/src/commands/moderation/hideCase.ts
@@ -20,8 +20,6 @@ export default class HideCaseCommand extends BushCommand {
}
}
],
- clientPermissions: (m) => util.clientSendAndPermCheck(m),
- userPermissions: (m) => util.userGuildPermCheck(m, ['MANAGE_MESSAGES']),
slash: true,
slashOptions: [
{
@@ -31,6 +29,8 @@ export default class HideCaseCommand extends BushCommand {
required: true
}
],
+ clientPermissions: (m) => util.clientSendAndPermCheck(m),
+ userPermissions: (m) => util.userGuildPermCheck(m, ['MANAGE_MESSAGES']),
channel: 'guild'
});
}
@@ -39,8 +39,6 @@ export default class HideCaseCommand extends BushCommand {
message: BushMessage | BushSlashMessage,
{ case_id: caseID }: { case_id: string }
): Promise<unknown> {
- if (message.author.id === '496409778822709251')
- return await message.util.reply(`${util.emojis.error} This command is Bestower proof.`);
const entry = await ModLog.findByPk(caseID);
if (!entry || entry.pseudo) return message.util.send(`${util.emojis.error} Invalid entry.`);
if (entry.guild !== message.guild!.id)
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts
index 9bd5658..3238217 100644
--- a/src/commands/moderation/kick.ts
+++ b/src/commands/moderation/kick.ts
@@ -80,17 +80,18 @@ export default class KickCommand extends BushCommand {
});
const responseMessage = () => {
+ const victim = util.format.bold(member.user.tag);
switch (responseCode) {
case 'missing permissions':
- return `${util.emojis.error} Could not kick **${member.user.tag}** because I am missing the \`Kick Members\` permission.`;
+ return `${util.emojis.error} Could not kick ${victim} because I am missing the \`Kick Members\` permission.`;
case 'error kicking':
- return `${util.emojis.error} An error occurred while trying to kick **${member.user.tag}**.`;
+ return `${util.emojis.error} An error occurred while trying to kick ${victim}.`;
case 'error creating modlog entry':
- return `${util.emojis.error} While muting **${member.user.tag}**, there was an error creating a modlog entry, please report this to my developers.`;
+ return `${util.emojis.error} While muting ${victim}, there was an error creating a modlog entry, please report this to my developers.`;
case 'failed to dm':
- return `${util.emojis.warn} Kicked **${member.user.tag}** however I could not send them a dm.`;
+ return `${util.emojis.warn} Kicked ${victim} however I could not send them a dm.`;
case 'success':
- return `${util.emojis.success} Successfully kicked **${member.user.tag}**.`;
+ return `${util.emojis.success} Successfully kicked ${victim}.`;
}
};
return await message.util.reply({ content: responseMessage(), allowedMentions: AllowedMentions.none() });
diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts
index eb37681..4abaa6f 100644
--- a/src/commands/moderation/modlog.ts
+++ b/src/commands/moderation/modlog.ts
@@ -50,7 +50,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**: ${util.discord.escapeItalic(log.id)}`, `**Type**: ${log.type.toLowerCase()}`];
+ const modLog = [`**Case ID**: ${util.discord.escapeMarkdown(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 03ecf2a..00631ba 100644
--- a/src/commands/moderation/mute.ts
+++ b/src/commands/moderation/mute.ts
@@ -30,11 +30,7 @@ export default class MuteCommand extends BushCommand {
optional: true
}
},
- {
- id: 'force',
- flag: '--force',
- match: 'flag'
- }
+ { id: '