From e536fb2f72e4883979b451b60b12c44f5f94313c Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Mon, 18 Jul 2022 18:30:53 +0200 Subject: replace all var with let (reduces warnings) --- util/src/entities/Channel.ts | 2 +- util/src/entities/Guild.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'util/src/entities') diff --git a/util/src/entities/Channel.ts b/util/src/entities/Channel.ts index 69c08be7..1a20153c 100644 --- a/util/src/entities/Channel.ts +++ b/util/src/entities/Channel.ts @@ -171,7 +171,7 @@ export class Channel extends BaseClass { if (!opts?.skipNameChecks) { const guild = await Guild.findOneOrFail({ id: channel.guild_id }); if (!guild.features.includes("ALLOW_INVALID_CHANNEL_NAMES") && channel.name) { - for (var character of InvisibleCharacters) + for (let character of InvisibleCharacters) if (channel.name.includes(character)) throw new HTTPError("Channel name cannot include invalid characters", 403); diff --git a/util/src/entities/Guild.ts b/util/src/entities/Guild.ts index 70bb41c5..328c586e 100644 --- a/util/src/entities/Guild.ts +++ b/util/src/entities/Guild.ts @@ -346,9 +346,9 @@ export class Guild extends BaseClass { }); for (const channel of body.channels?.sort((a, b) => (a.parent_id ? 1 : -1))) { - var id = ids.get(channel.id) || Snowflake.generate(); + let id = ids.get(channel.id) || Snowflake.generate(); - var parent_id = ids.get(channel.parent_id); + let parent_id = ids.get(channel.parent_id); await Channel.createChannel({ ...channel, guild_id, id, parent_id }, body.owner_id, { keepId: true, -- cgit 1.5.1