Skip to content

Commit 3834fcd

Browse files
committed
remove commented
1 parent acebf94 commit 3834fcd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+46
-486
lines changed

src/@types/i18next.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type dev from "../../locales/en-US/dev.json";
77
import type events from "../../locales/en-US/events.json";
88
import type player from "../../locales/en-US/player.json";
99

10-
/** Define i18n structure */
1110
export interface I18nResourceSchema {
1211
commands: typeof commands;
1312
common: typeof common;

src/@types/intl.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**
2-
* Official TypeScript definitions for Intl.DurationFormat are missing.
3-
*
4-
* {@link https://github.com/microsoft/TypeScript#60608}
5-
*/
6-
71
import type {
82
DurationFormatOptions as _DurationFormatOptions,
93
DurationInput as _DurationInput,

src/LavaClient.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,4 @@ export async function launch() {
4949
await client.start(env.TOKEN);
5050
}
5151

52-
// Allow standalone execution in dev mode (when this file is the entry point)
5352
if (import.meta.main) launch();

src/commands/config/Language.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ import {
1212
ViewChannel,
1313
} from "../../utils/Permissions";
1414

15-
/** Persistent cache for Intl.DisplayNames instances */
1615
const displayNamesCache = new Map<string, Intl.DisplayNames>();
1716

18-
/** Gets or creates an Intl.DisplayNames instance for a specific locale. */
1917
function getDisplayNames(locale: string): Intl.DisplayNames {
2018
let instance = displayNamesCache.get(locale);
2119
if (!instance) {
@@ -25,13 +23,6 @@ function getDisplayNames(locale: string): Intl.DisplayNames {
2523
return instance;
2624
}
2725

28-
/**
29-
* Resolves localized components of a language.
30-
*
31-
* Returns the flag, the plain localized name, and a combined "full" version.
32-
*
33-
* @example full: "🇺🇸 English"
34-
*/
3526
function getLocalizedName(langCode: string, targetLocale: string) {
3627
const flag = getEmojiFlag(langCode);
3728
let name: string;
@@ -107,7 +98,6 @@ export default class LanguageCommand extends Command {
10798
? (ctx.options.get("language")?.value as string)
10899
: args[0];
109100

110-
/** Resolve key names (e.g. "EnglishUS") to codes (e.g. "en-US") */
111101
let langCode: string = targetInput;
112102
if (targetInput in Locale) langCode = Locale[targetInput as keyof typeof Locale];
113103

@@ -190,13 +180,10 @@ export default class LanguageCommand extends Command {
190180
};
191181
});
192182

193-
/** Use language-sensitive sorting */
194183
choices.sort((a, b) => a.sortKey.localeCompare(b.sortKey, userLocale));
195184

196-
// If there's no input, return the first 25 sorted choices
197185
if (!input) return void (await interaction.respond(choices.slice(0, 25)).catch(() => null));
198186

199-
// If user is typing, filter and return results
200187
const filtered = choices
201188
.filter((choice) => choice.name.toLowerCase().includes(input))
202189
.slice(0, 25);

src/commands/config/Setup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/** biome-ignore-all lint/style/noNonNullAssertion: explanation */
21
import { ChannelType, OverwriteType, PermissionFlagsBits } from "discord.js";
32
import { I18N } from "../../structures/I18n";
43
import { Command, type Context, type Lavamusic } from "../../structures/index";

src/commands/dev/CreateInvite.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export default class CreateInvite extends Command {
4747
});
4848
}
4949

50-
// Search for a channel where the bot has invite permissions
5150
const textChannel = guild.channels.cache.find(
5251
(channel) =>
5352
channel.type === ChannelType.GuildText &&

src/commands/dev/DeleteInvites.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export default class DestroyInvites extends Command {
4646
}
4747

4848
try {
49-
// Fetch all invites and filter only those created by the bot
5049
const invites = await guild.invites.fetch();
5150
const botInvites = invites.filter((invite) => invite.inviterId === client.user?.id);
5251

@@ -61,7 +60,6 @@ export default class DestroyInvites extends Command {
6160
});
6261
}
6362

64-
// Parallel deletion
6563
await Promise.all(botInvites.map((invite) => invite.delete("Developer Cleanup")));
6664

6765
return await ctx.sendMessage({

src/commands/dev/Deploy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ export default class Deploy extends Command {
9595

9696
await interaction.deferUpdate();
9797

98-
// customId format is "action-scope" (e.g., "undeploy-guild")
9998
const [action, scope] = interaction.customId.split("-") as [ActionType, ScopeType];
10099
const isClear = action === "undeploy";
101100
const guildId = scope === "guild" ? interaction.guildId! : undefined;

src/commands/dev/GuildList.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export default class GuildList extends Command {
4040
);
4141
allGuilds = results.flat();
4242
} catch {
43-
// Fallback to local cache if cross-shard request fails
4443
allGuilds = client.guilds.cache.map((g) => ({
4544
name: g.name,
4645
id: g.id,

src/commands/dev/MoveNode.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ export default class MoveNode extends Command {
4141
}
4242

4343
public async run(client: Lavamusic, ctx: Context, args: string[]): Promise<any> {
44-
// If no node specified, show available nodes as before
4544
let nodeId: string | undefined;
4645
if (args.length > 0) {
4746
nodeId = args.join(" ");
4847
} else if (ctx.options && typeof ctx.options.get === "function") {
49-
const nodeOption = ctx.options.get("node", /* required */ false);
48+
const nodeOption = ctx.options.get("node", false);
5049
nodeId = nodeOption?.value as string | undefined;
5150
} else {
5251
nodeId = undefined;
@@ -101,7 +100,6 @@ export default class MoveNode extends Command {
101100
});
102101
}
103102

104-
// Validate the target node exists and is connected
105103
const targetNode = client.manager.nodeManager.nodes.get(nodeId);
106104
if (!targetNode) {
107105
return await ctx.sendMessage({
@@ -129,7 +127,6 @@ export default class MoveNode extends Command {
129127
});
130128
}
131129

132-
// If all players are already on the target node
133130
const allOnTarget = Array.from(allPlayers.values()).every(
134131
(player) => player.node.options.id === nodeId,
135132
);
@@ -158,7 +155,6 @@ export default class MoveNode extends Command {
158155
});
159156
}
160157

161-
// Move all players to the new node
162158
const results: {
163159
guildId: string;
164160
from: string;
@@ -185,7 +181,6 @@ export default class MoveNode extends Command {
185181
}
186182
}
187183

188-
// Prepare summary
189184
const successMoves = results.filter((r) => !r.error);
190185
const failedMoves = results.filter((r) => r.error);
191186

@@ -221,7 +216,6 @@ export default class MoveNode extends Command {
221216
description = ctx.locale(I18N.commands.movenode.messages.no_players_moved);
222217
}
223218

224-
// Send a summary message
225219
const resultTitle = ctx.locale(I18N.commands.movenode.messages.results_title);
226220
const resultColor = failedMoves.length > 0 ? this.client.color.red : this.client.color.green;
227221
const resultTimestamp = new Date().toISOString();
@@ -252,7 +246,7 @@ export default class MoveNode extends Command {
252246
return;
253247
} catch (error) {
254248
logger.error("Failed to move player nodes:", error);
255-
// Error handling
249+
256250
if (ctx.interaction && (ctx.interaction.replied || ctx.interaction.deferred)) {
257251
await ctx.editMessage({
258252
embeds: [

0 commit comments

Comments
 (0)