aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands/info/userInfo.ts8
-rw-r--r--src/commands/leveling/leaderboard.ts4
-rw-r--r--src/commands/utilities/suicide.ts2
-rw-r--r--src/lib/extensions/discord-akairo/BushCommand.ts7
-rw-r--r--src/listeners/commands/commandMissingPermissions.ts6
5 files changed, 17 insertions, 10 deletions
diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts
index 98ef3ae..b01c268 100644
--- a/src/commands/info/userInfo.ts
+++ b/src/commands/info/userInfo.ts
@@ -96,10 +96,10 @@ export default class UserInfoCommand extends BushCommand {
const generalInfo = [
`**Mention:** <@${user.id}>`,
`**ID:** ${user.id}`,
- `**Created: **${createdAt} (${createdAtDelta} ago)`
+ `**Created:** ${createdAt} (${createdAtDelta} ago)`
];
if (user.accentColor !== null) generalInfo.push(`**Accent Color:** ${user.hexAccentColor}`);
- if (user.banner) generalInfo.push(`**Banner**: [link](${user.bannerURL({ dynamic: true, format: 'png', size: 4096 })})`);
+ if (user.banner) generalInfo.push(`**Banner:** [link](${user.bannerURL({ dynamic: true, format: 'png', size: 4096 })})`);
const pronouns = await util.getPronounsOf(user);
if (pronouns) generalInfo.push(`**Pronouns:** ${pronouns}`);
@@ -109,7 +109,7 @@ export default class UserInfoCommand extends BushCommand {
const serverUserInfo = [];
if (joinedAt)
serverUserInfo.push(
- `**${message.guild!.ownerId == user.id ? 'Created Server' : 'Joined'}: ** ${joinedAt} (${joinedAtDelta} ago)`
+ `**${message.guild!.ownerId == user.id ? 'Created Server' : 'Joined'}:** ${joinedAt} (${joinedAtDelta} ago)`
);
if (premiumSince) serverUserInfo.push(`**Boosting Since:** ${premiumSince} (${premiumSinceDelta} ago)`);
if (member?.displayHexColor) serverUserInfo.push(`**Display Color:** ${member.displayHexColor}`);
@@ -120,7 +120,7 @@ export default class UserInfoCommand extends BushCommand {
message.guild?.id == client.consts.mappings.guilds.bush
)
serverUserInfo.push(`**General Deletions:** ⅓`);
- if (member?.nickname) serverUserInfo.push(`**Nickname** ${member?.nickname}`);
+ if (member?.nickname) serverUserInfo.push(`**Nickname:** ${member?.nickname}`);
if (serverUserInfo.length)
userEmbed.addField('» Server Info', serverUserInfo.join('\n')).setColor(member?.displayColor ?? util.colors.default);
diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts
index 4fb1765..432fc60 100644
--- a/src/commands/leveling/leaderboard.ts
+++ b/src/commands/leveling/leaderboard.ts
@@ -55,10 +55,10 @@ export default class LeaderboardCommand extends BushCommand {
);
const ranks = (await Level.findAll({ where: { guild: message.guild.id } })).sort((a, b) => b.xp - a.xp);
- const mapedRanks = ranks.map(
+ const mappedRanks = ranks.map(
(val, index) => `\`${index + 1}\` <@${val.user}> - Level ${val.level} (${val.xp.toLocaleString()} xp)`
);
- const chunked = util.chunk(mapedRanks, 25);
+ const chunked = util.chunk(mappedRanks, 25);
const embeds = chunked.map((c) =>
new MessageEmbed().setTitle(`${message.guild!.name}'s Leaderboard`).setDescription(c.join('\n'))
);
diff --git a/src/commands/utilities/suicide.ts b/src/commands/utilities/suicide.ts
index a05cdaa..58119ef 100644
--- a/src/commands/utilities/suicide.ts
+++ b/src/commands/utilities/suicide.ts
@@ -33,7 +33,7 @@ export default class TemplateCommand extends BushCommand {
**Text: HOME** to 741741
https://suicidepreventionlifeline.org/chat/
-Outside the U.S: Find a supportive resource on [this Wikipedia list of worldwide crisis hotlines](https://en.wikipedia.org/wiki/List_of_suicide_crisis_lines)`
+**Outside the U.S**: Find a supportive resource on [this Wikipedia list of worldwide crisis hotlines](https://en.wikipedia.org/wiki/List_of_suicide_crisis_lines)`
)
.addField(
'**More Support**',
diff --git a/src/lib/extensions/discord-akairo/BushCommand.ts b/src/lib/extensions/discord-akairo/BushCommand.ts
index 073221d..548f921 100644
--- a/src/lib/extensions/discord-akairo/BushCommand.ts
+++ b/src/lib/extensions/discord-akairo/BushCommand.ts
@@ -139,8 +139,11 @@ export interface CustomBushArgumentOptions extends BaseBushArgumentOptions {
export type BushMissingPermissionSupplier = (message: BushMessage | BushSlashMessage) => Promise<any> | any;
export interface BushCommandOptions extends Omit<CommandOptions, 'userPermissions' | 'clientPermissions'> {
+ /** Whether the command is hidden from the help command. */
hidden?: boolean;
+ /** The channels the command is limited to run in. */
restrictedChannels?: Snowflake[];
+ /** The guilds the command is limited to run in. */
restrictedGuilds?: Snowflake[];
description: {
content: string;
@@ -149,9 +152,13 @@ export interface BushCommandOptions extends Omit<CommandOptions, 'userPermission
};
args?: BushArgumentOptions[] & CustomBushArgumentOptions[];
category: string;
+ /** A fake command, completely hidden from the help command. */
pseudo?: boolean;
+ /** Allow this command to be run in channels that are blacklisted. */
bypassChannelBlacklist?: boolean;
+ /** Permissions required by the client to run this command. */
clientPermissions?: PermissionResolvable | PermissionResolvable[] | BushMissingPermissionSupplier;
+ /** Permissions required by the user to run this command. */
userPermissions?: PermissionResolvable | PermissionResolvable[] | BushMissingPermissionSupplier;
}
diff --git a/src/listeners/commands/commandMissingPermissions.ts b/src/listeners/commands/commandMissingPermissions.ts
index 7d69456..1917ce0 100644
--- a/src/listeners/commands/commandMissingPermissions.ts
+++ b/src/listeners/commands/commandMissingPermissions.ts
@@ -20,9 +20,9 @@ export default class CommandMissingPermissionsListener extends BushListener {
| BushCommandHandlerEvents['missingPermissions']
| BushCommandHandlerEvents['slashMissingPermissions']
): Promise<unknown> {
- const niceMissing = missing.includes('ADMINISTRATOR')
- ? ['ADMINISTRATOR']
- : missing.map((perm) => client.consts.mappings.permissions[perm]?.name ?? missing);
+ const niceMissing = (missing.includes('ADMINISTRATOR') ? (['ADMINISTRATOR'] as 'ADMINISTRATOR'[]) : missing).map(
+ (perm) => client.consts.mappings.permissions[perm]?.name ?? missing
+ );
const discordFormat = util.oxford(util.surroundArray(niceMissing, '**'), 'and', '');
const consoleFormat = util.oxford(util.surroundArray(niceMissing, '<<', '>>'), 'and', '');