Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit 16f8974

Browse files
committed
fix(config): set default permissions for invite link command and adjust server name length display
1 parent 8955c6a commit 16f8974

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/commands/Main/config/set-invite.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import BaseCommand from '#src/core/BaseCommand.js';
1919
import Context from '#src/core/CommandContext/Context.js';
2020
import db from '#src/utils/Db.js';
21-
import { ApplicationCommandOptionType, Invite } from 'discord.js';
21+
import { ApplicationCommandOptionType, Invite, PermissionsBitField } from 'discord.js';
2222

2323
export default class ConfigSetInviteSubcommand extends BaseCommand {
2424
constructor() {
@@ -27,6 +27,7 @@ export default class ConfigSetInviteSubcommand extends BaseCommand {
2727
description:
2828
'Set the invite link for the server. People can use it to join through InterChat leaderboards.',
2929
types: { slash: true, prefix: true },
30+
defaultPermissions: new PermissionsBitField('ManageMessages'),
3031
options: [
3132
{
3233
type: ApplicationCommandOptionType.String,

src/utils/Leaderboard.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ export async function formatUserLeaderboard(
109109
output += `${rankDisplay.padEnd(2)} | ${username.padEnd(18)} | ${score.toString().padEnd(7)}\n`;
110110
}
111111

112-
// Wrap the table in a code block for fixed-width font.
113112
return `\`\`\`css\n${output}\`\`\``;
114113
}
115114

@@ -140,7 +139,7 @@ export async function formatServerLeaderboard(
140139

141140
// Limit the server name length for table formatting.
142141
const serverName =
143-
guild.name.length > 20 ? `${guild.name.slice(0, 18)}..` : guild.name;
142+
guild.name.length > 20 ? `${guild.name.slice(0, 17)}...` : guild.name;
144143
const serverData = inviteLinks.find(
145144
(link) => link.id === serverId && Boolean(link.inviteCode),
146145
);
@@ -155,6 +154,5 @@ export async function formatServerLeaderboard(
155154
output += `${rankDisplay.padEnd(2)} | ${serverName.padEnd(20)} | ${score.toString().padEnd(3)} | ${invite.padEnd(15)}\n`;
156155
}
157156

158-
// Wrap the table in a code block for fixed-width font.
159157
return `\`\`\`css\n${output}\`\`\``;
160158
}

0 commit comments

Comments
 (0)