diff --git a/.github/config.json b/.github/config.json index bf96735e..710eded9 100644 --- a/.github/config.json +++ b/.github/config.json @@ -9,9 +9,7 @@ "command_prefix": ".", "mod_prefix": "~" }, - "moderator_roles": [ - "Moderader" - ], + "moderator_roles": ["Moderader"], "moderator_id": "893179190709477413", "ban_reason_channel_id": "893179190881452117", "woisping_limit": 7200, @@ -19,9 +17,7 @@ "quotes": { "emoji_name": "zitat", "emoji_id": "905042096724017212", - "allowed_group_ids": [ - "893179190709477407" - ], + "allowed_group_ids": ["893179190709477407"], "quote_threshold": 2, "anonymous_channel_ids": [], "blacklisted_channel_ids": [], @@ -30,15 +26,9 @@ }, "delete_thread_messages_in_channels": ["893179191556706384"], "ehre": { - "emoji_names": [ - "ähre", - "aehre", - "pr0aehre" - ] + "emoji_names": ["ähre", "aehre", "pr0aehre"] }, - "faulenzerping_allowed_role_ids": [ - - ], + "faulenzerping_allowed_role_ids": [], "faulenzerping_max_pings": 10, "faulenzerping_min_required_reactions": 5, "flame_trusted_user_on_bot_ping": false @@ -50,7 +40,7 @@ "banned_role_id": "893179190709477409", "bday_role_id": "893179190709477416", "woisgang_role_id": "893179190235508825", - "shame_role_id": "893179190235508822", + "shame_role_id": "893179190235508822", "winner_role_id": "1045422896740311070", "bot_deny_role_id": "1025870480374247485", diff --git a/package-lock.json b/package-lock.json index 01d2ee4c..1f15972a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "sqlite3": "~5.1.7" }, "devDependencies": { - "@biomejs/biome": "^1.4.1", + "@biomejs/biome": "^1.5.3", "@ffprobe-installer/ffprobe": "^2.1.2", "@types/jsdom": "^21.1.6", "@types/minimist": "^1.2.5", @@ -56,9 +56,9 @@ } }, "node_modules/@biomejs/biome": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.4.1.tgz", - "integrity": "sha512-JccVAwPbhi37pdxbAGmaOBjUTKEwEjWAhl7rKkVVuXHo4MLASXJ5HR8BTgrImi4/7rTBsGz1tgVD1Kwv1CHGRg==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.5.3.tgz", + "integrity": "sha512-yvZCa/g3akwTaAQ7PCwPWDCkZs3Qa5ONg/fgOUT9e6wAWsPftCjLQFPXBeGxPK30yZSSpgEmRCfpGTmVbUjGgg==", "dev": true, "hasInstallScript": true, "bin": { @@ -72,18 +72,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.4.1", - "@biomejs/cli-darwin-x64": "1.4.1", - "@biomejs/cli-linux-arm64": "1.4.1", - "@biomejs/cli-linux-x64": "1.4.1", - "@biomejs/cli-win32-arm64": "1.4.1", - "@biomejs/cli-win32-x64": "1.4.1" + "@biomejs/cli-darwin-arm64": "1.5.3", + "@biomejs/cli-darwin-x64": "1.5.3", + "@biomejs/cli-linux-arm64": "1.5.3", + "@biomejs/cli-linux-arm64-musl": "1.5.3", + "@biomejs/cli-linux-x64": "1.5.3", + "@biomejs/cli-linux-x64-musl": "1.5.3", + "@biomejs/cli-win32-arm64": "1.5.3", + "@biomejs/cli-win32-x64": "1.5.3" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.4.1.tgz", - "integrity": "sha512-PZWy2Idndqux38p6AXSDQM2ldRAWi32bvb7bMbTN0ALzpWYMYnxd71ornatumSSJYoNhKmxzDLq+jct7nZJ79w==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.5.3.tgz", + "integrity": "sha512-ImU7mh1HghEDyqNmxEZBoMPr8SxekkZuYcs+gynKlNW+TALQs7swkERiBLkG9NR0K1B3/2uVzlvYowXrmlW8hw==", "cpu": [ "arm64" ], @@ -97,9 +99,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.4.1.tgz", - "integrity": "sha512-soj3BWhnsM1M2JlzR09cibUzG1owJqetwj/Oo7yg0foijo9lNH9XWXZfJBYDKgW/6Fomn+CC2EcUS+hisQzt9g==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.5.3.tgz", + "integrity": "sha512-vCdASqYnlpq/swErH7FD6nrFz0czFtK4k/iLgj0/+VmZVjineFPgevOb+Sr9vz0tk0GfdQO60bSpI74zU8M9Dw==", "cpu": [ "x64" ], @@ -113,9 +115,25 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.4.1.tgz", - "integrity": "sha512-YIZqfJUg4F+fPsBTXxgD7EU2E5OAYbmYSl/snf4PevwfQCWE/omOFZv+NnIQmjYj9I7ParDgcJvanoA3/kO0JQ==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.5.3.tgz", + "integrity": "sha512-cupBQv0sNF1OKqBfx7EDWMSsKwRrBUZfjXawT4s6hKV6ALq7p0QzWlxr/sDmbKMLOaLQtw2Qgu/77N9rm+f9Rg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.5.3.tgz", + "integrity": "sha512-DYuMizUYUBYfS0IHGjDrOP1RGipqWfMGEvNEJ398zdtmCKLXaUvTimiox5dvx4X15mBK5M2m8wgWUgOP1giUpQ==", "cpu": [ "arm64" ], @@ -129,9 +147,25 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.4.1.tgz", - "integrity": "sha512-9YOZw3qBd/KUj63A6Hn2zZgzGb2nbESM0qNmeMXgmqinVKM//uc4OgY5TuKITuGjMSvcVxxd4dX1IzYjV9qvNQ==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.5.3.tgz", + "integrity": "sha512-YQrSArQvcv4FYsk7Q91Yv4uuu5F8hJyORVcv3zsjCLGkjIjx2RhjYLpTL733SNL7v33GmOlZY0eFR1ko38tuUw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.5.3.tgz", + "integrity": "sha512-UUHiAnlDqr2Y/LpvshBFhUYMWkl2/Jn+bi3U6jKuav0qWbbBKU/ByHgR4+NBxpKBYoCtWxhnmatfH1bpPIuZMw==", "cpu": [ "x64" ], @@ -145,9 +179,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.4.1.tgz", - "integrity": "sha512-nWQbvkNKxYn/kCQ0yVF8kCaS3VzaGvtFSmItXiMknU4521LDjJ7tNWH12Gol+pIslrCbd4E1LhJa0a3ThRsBVg==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.5.3.tgz", + "integrity": "sha512-HxatYH7vf/kX9nrD+pDYuV2GI9GV8EFo6cfKkahAecTuZLPxryHx1WEfJthp5eNsE0+09STGkKIKjirP0ufaZA==", "cpu": [ "arm64" ], @@ -161,9 +195,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.4.1.tgz", - "integrity": "sha512-88fR2CQxQ4YLs2BUDuywWYQpUKgU3A3sTezANFc/4LGKQFFLV2yX+F7QAdZVkMHfA+RD9Xg178HomM/6mnTNPA==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.5.3.tgz", + "integrity": "sha512-fMvbSouZEASU7mZH8SIJSANDm5OqsjgtVXlbUqxwed6BP7uuHRSs396Aqwh2+VoW8fwTpp6ybIUoC9FrzB0kyA==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index 09d59497..2da1497a 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "sqlite3": "~5.1.7" }, "devDependencies": { - "@biomejs/biome": "^1.4.1", + "@biomejs/biome": "^1.5.3", "@ffprobe-installer/ffprobe": "^2.1.2", "@types/jsdom": "^21.1.6", "@types/minimist": "^1.2.5", diff --git a/src/commands/faulenzerping.ts b/src/commands/faulenzerping.ts index 3ac18550..661cae6c 100644 --- a/src/commands/faulenzerping.ts +++ b/src/commands/faulenzerping.ts @@ -1,6 +1,7 @@ import { ActionRowBuilder, ApplicationCommandType, + CacheType, Client, CommandInteraction, ComponentType, @@ -8,6 +9,7 @@ import { Message, Role, RoleSelectMenuBuilder, + RoleSelectMenuInteraction, Snowflake, } from "discord.js"; @@ -54,7 +56,7 @@ export class FaulenzerPingCommand implements ApplicationCommand { ephemeral: true, }); - let confirmation; + let confirmation: RoleSelectMenuInteraction; try { confirmation = await response.awaitMessageComponent({ filter: i => i.user.id === command.user.id, diff --git a/src/commands/google.ts b/src/commands/google.ts index c5d2542d..808c2607 100644 --- a/src/commands/google.ts +++ b/src/commands/google.ts @@ -78,16 +78,13 @@ export class GoogleCommand implements ApplicationCommand { "+", )})`; - let reply; - if (!dau) { - reply = replies[Math.floor(Math.random() * replies.length)].replace( - "{0}", - link, + const randomReply = replies[Math.floor(Math.random() * replies.length)]; + let reply = randomReply.replace("{0}", link); + if (dau) { + reply = reply.replace( + "{1}", + `${dau?.nickname ?? dau?.displayName}`, ); - } else { - reply = repliesWithUser[Math.floor(Math.random() * replies.length)] - .replace("{0}", link) - .replace("{1}", `${dau?.nickname ?? dau?.displayName}`); } const embed = buildEmbed(user, reply); diff --git a/src/commands/poll.ts b/src/commands/poll.ts index ae8ca970..61ff5216 100644 --- a/src/commands/poll.ts +++ b/src/commands/poll.ts @@ -244,7 +244,6 @@ export const run: CommandFunction = async (_client, message, args, context) => { const reactionMap: string[] = []; const reactions: string[][] = []; - // biome-ignore lint/complexity/noForEach: We need the index here pollOptions.forEach((option, index) => { reactionMap[index] = option; reactions[index] = []; diff --git a/src/commands/sdm.ts b/src/commands/sdm.ts index 239082bd..1951adf7 100644 --- a/src/commands/sdm.ts +++ b/src/commands/sdm.ts @@ -38,7 +38,7 @@ const createSecureDecisionMessage = ( // If yes / no if (options.length === 0) { const decision = crypto.randomInt(2); - let file; + let file: string; if (decision) { embed.setColor(0x2ecc71); file = "yes.png"; diff --git a/src/handler/reactionHandler.ts b/src/handler/reactionHandler.ts index 948836b9..ba9fbd04 100644 --- a/src/handler/reactionHandler.ts +++ b/src/handler/reactionHandler.ts @@ -96,7 +96,6 @@ export default { if (isStrawpoll) { if (isDelayedPoll) { for (const reactionList of delayedPoll.reactions) { - // biome-ignore lint/complexity/noForEach: We need the index here reactionList.forEach((x, i) => { if (x === member.id) reactionList.splice(i); }); diff --git a/src/utils/configHandler.ts b/src/utils/configHandler.ts index 2788ce74..e403852c 100644 --- a/src/utils/configHandler.ts +++ b/src/utils/configHandler.ts @@ -17,7 +17,7 @@ export const getConfig = () => { process.exit(1); } - let jsonString; + let jsonString: string; try { jsonString = fs.readFileSync(configPath, "utf8"); } catch (e) {