From b6402733c51c6fa83779a0fee263f70def154afe Mon Sep 17 00:00:00 2001 From: hwangsihu Date: Sun, 6 Oct 2024 23:43:31 +0900 Subject: [PATCH 1/6] Update package and format --- biome.json | 2 +- package.json | 2 +- src/events/client/VoiceStateUpdate.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/biome.json b/biome.json index 1405b9c85..ce00ba724 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.2/schema.json", + "$schema": "https://biomejs.dev/schemas/1.9.3/schema.json", "vcs": { "enabled": true, "clientKind": "git", diff --git a/package.json b/package.json index 924fa67c2..d0d95927e 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "homepage": "https://github.com/appujet/lavamusic#readme", "devDependencies": { - "@biomejs/biome": "^1.9.2", + "@biomejs/biome": "^1.9.3", "@types/i18n": "^0.13.12", "@types/node": "^22.7.4", "@types/signale": "^1.4.7", diff --git a/src/events/client/VoiceStateUpdate.ts b/src/events/client/VoiceStateUpdate.ts index 3413ee977..47d6fbdb1 100644 --- a/src/events/client/VoiceStateUpdate.ts +++ b/src/events/client/VoiceStateUpdate.ts @@ -47,7 +47,7 @@ export default class VoiceStateUpdate extends Event { handale = { async join(newState: VoiceState, client: Lavamusic) { - await new Promise((resolve) => setTimeout(resolve, 3000)); + await new Promise(resolve => setTimeout(resolve, 3000)); const bot = newState.guild.voiceStates.cache.get(client.user!.id); if (!bot) return; @@ -58,7 +58,7 @@ export default class VoiceStateUpdate extends Event { bot.suppress ) { if (bot.channel && bot.member && bot.channel.permissionsFor(bot.member!).has('MuteMembers')) { - await bot.setSuppressed(false) + await bot.setSuppressed(false); } } @@ -114,7 +114,7 @@ export default class VoiceStateUpdate extends Event { async move(newState: VoiceState, client: Lavamusic) { // delay for 3 seconds - await new Promise((resolve) => setTimeout(resolve, 3000)); + await new Promise(resolve => setTimeout(resolve, 3000)); const bot = newState.guild.voiceStates.cache.get(client.user!.id); if (!bot) return; @@ -125,7 +125,7 @@ export default class VoiceStateUpdate extends Event { bot.suppress ) { if (bot.channel && bot.member && bot.channel.permissionsFor(bot.member!).has('MuteMembers')) { - await bot.setSuppressed(false) + await bot.setSuppressed(false); } } }, From 56f095ec429d8fdad1fae7f4a08cd202d9b9254c Mon Sep 17 00:00:00 2001 From: hwangsihu Date: Mon, 7 Oct 2024 10:50:25 +0900 Subject: [PATCH 2/6] Formatting --- src/events/player/PlayerDestroy.ts | 48 +++++++++++++-------------- src/events/player/PlayerDisconnect.ts | 48 +++++++++++++-------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/events/player/PlayerDestroy.ts b/src/events/player/PlayerDestroy.ts index f5ead1230..bfa9fb3aa 100644 --- a/src/events/player/PlayerDestroy.ts +++ b/src/events/player/PlayerDestroy.ts @@ -4,35 +4,35 @@ import { Event, type Lavamusic } from '../../structures/index'; import { updateSetup } from '../../utils/SetupSystem'; export default class PlayerDestroy extends Event { - constructor(client: Lavamusic, file: string) { - super(client, file, { - name: 'playerDestroy', - }); - } + constructor(client: Lavamusic, file: string) { + super(client, file, { + name: 'playerDestroy', + }); + } - public async run(player: Player, _reason: string): Promise { - const guild = this.client.guilds.cache.get(player.guildId); - if (!guild) return; - const locale = await this.client.db.getLanguage(player.guildId); - await updateSetup(this.client, guild, locale); + public async run(player: Player, _reason: string): Promise { + const guild = this.client.guilds.cache.get(player.guildId); + if (!guild) return; + const locale = await this.client.db.getLanguage(player.guildId); + await updateSetup(this.client, guild, locale); - const messageId = player.get('messageId'); - if (!messageId) return; + const messageId = player.get('messageId'); + if (!messageId) return; - const channel = guild.channels.cache.get(player.textChannelId!) as TextChannel; - if (!channel) return; + const channel = guild.channels.cache.get(player.textChannelId!) as TextChannel; + if (!channel) return; - const message = await channel.messages.fetch(messageId).catch(() => { - null; - }); - if (!message) return; + const message = await channel.messages.fetch(messageId).catch(() => { + null; + }); + if (!message) return; - if (message.editable) { - await message.edit({ components: [] }).catch(() => { - null; - }); - } - } + if (message.editable) { + await message.edit({ components: [] }).catch(() => { + null; + }); + } + } } /** diff --git a/src/events/player/PlayerDisconnect.ts b/src/events/player/PlayerDisconnect.ts index 630e5a8f7..78183fb77 100644 --- a/src/events/player/PlayerDisconnect.ts +++ b/src/events/player/PlayerDisconnect.ts @@ -4,35 +4,35 @@ import { Event, type Lavamusic } from '../../structures/index'; import { updateSetup } from '../../utils/SetupSystem'; export default class PlayerDisconnect extends Event { - constructor(client: Lavamusic, file: string) { - super(client, file, { - name: 'playerDisconnect', - }); - } + constructor(client: Lavamusic, file: string) { + super(client, file, { + name: 'playerDisconnect', + }); + } - public async run(player: Player, _voiceChannelId: string): Promise { - const guild = this.client.guilds.cache.get(player.guildId); - if (!guild) return; - const locale = await this.client.db.getLanguage(player.guildId); - await updateSetup(this.client, guild, locale); + public async run(player: Player, _voiceChannelId: string): Promise { + const guild = this.client.guilds.cache.get(player.guildId); + if (!guild) return; + const locale = await this.client.db.getLanguage(player.guildId); + await updateSetup(this.client, guild, locale); - const messageId = player.get('messageId'); - if (!messageId) return; + const messageId = player.get('messageId'); + if (!messageId) return; - const channel = guild.channels.cache.get(player.textChannelId!) as TextChannel; - if (!channel) return; + const channel = guild.channels.cache.get(player.textChannelId!) as TextChannel; + if (!channel) return; - const message = await channel.messages.fetch(messageId).catch(() => { - null; - }); - if (!message) return; + const message = await channel.messages.fetch(messageId).catch(() => { + null; + }); + if (!message) return; - if (message.editable) { - await message.edit({ components: [] }).catch(() => { - null; - }); - } - } + if (message.editable) { + await message.edit({ components: [] }).catch(() => { + null; + }); + } + } } /** From ff4f0d81cf1dcae07c0b16449de22a70c0cbf3a9 Mon Sep 17 00:00:00 2001 From: hwangsihu Date: Tue, 8 Oct 2024 19:04:46 +0900 Subject: [PATCH 3/6] Update config --- .env.example | 2 +- src/env.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index be534fb47..a0e2dd8dc 100644 --- a/.env.example +++ b/.env.example @@ -15,4 +15,4 @@ DATABASE_URL="" # Your database url (If you want to use sqlite, then you can lea AUTO_NODE=="false" # true for auto node. It is given from lavainfo-api (https://lavainfo-api.deno.dev). SEARCH_ENGINE="YouTubeMusic" # Search engine to be used when playing the song. You can use: YouTube, YouTubeMusic, SoundCloud, Spotify, Apple, Deezer, Yandex and JioSaavn GENIUS_API="" # Sign up and get your own api at (https://genius.com/) to fetch your lyrics (CLIENT TOKEN) -NODES=[{"id":"Local Node","host":"localhost","port":2333,"authorization":"youshallnotpass","retryAmount":5,"retryDelay":60000,"secure":"false"}] +NODES=[{"id":"Local Node","host":"localhost","port":2333,"authorization":"youshallnotpass","secure":false,"retryAmount":5,"retryDelay":60000}] diff --git a/src/env.ts b/src/env.ts index 6b8218d26..754ca6be3 100644 --- a/src/env.ts +++ b/src/env.ts @@ -11,7 +11,7 @@ const LavalinkNodeSchema = z.object({ host: z.string(), port: z.number(), authorization: z.string(), - secure: z.preprocess(val => (val === 'true' || val === 'false' ? val === 'true' : val), z.boolean().optional()), + secure: z.boolean().optional(), sessionId: z.string().optional(), regions: z.string().array().optional(), retryAmount: z.number().optional(), From 8159fb0546a7c6e272a538970caca7a9c0ecc02e Mon Sep 17 00:00:00 2001 From: hwangsihu Date: Tue, 8 Oct 2024 20:06:35 +0900 Subject: [PATCH 4/6] Update package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d0d95927e..229735230 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "devDependencies": { "@biomejs/biome": "^1.9.3", "@types/i18n": "^0.13.12", - "@types/node": "^22.7.4", + "@types/node": "^22.7.5", "@types/signale": "^1.4.7", "prisma": "^5.20.0", "tslib": "^2.7.0", From ea0f7b8b17951c98064e9f87ea02242cc896b5f4 Mon Sep 17 00:00:00 2001 From: hwangsihu Date: Tue, 8 Oct 2024 22:31:50 +0900 Subject: [PATCH 5/6] Fix issues template and remove useless text box --- .github/ISSUE_TEMPLATE/bug_report.yaml | 5 +++-- .github/ISSUE_TEMPLATE/feature_request.yaml | 14 +++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 2e04496e6..200796b4f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -8,7 +8,7 @@ body: - type: markdown attributes: value: "## 🐞 Bug Report\n\nPlease fill out the information below to help us resolve the issue as quickly as possible." - + - type: textarea id: description attributes: @@ -44,6 +44,7 @@ body: placeholder: "e.g., 14.17.0" validations: required: true + - type: input id: java-version attributes: @@ -74,4 +75,4 @@ body: attributes: label: "Additional context" description: "Provide any other context or information that might be helpful." - placeholder: "Any additional details..." \ No newline at end of file + placeholder: "Any additional details..." diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 5777c6042..9c5304547 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -9,16 +9,8 @@ body: attributes: value: | ## Feature Request - Please provide a detailed description of the feature you're suggesting. If applicable, describe any related problem and the potential benefits of implementing this feature. - - type: input - id: title - attributes: - label: "Feature Title" - description: "Provide a brief title for your feature request" - placeholder: "Enter a concise title" - validations: - required: true + - type: textarea id: problem_description attributes: @@ -27,6 +19,7 @@ body: placeholder: "Describe the problem" validations: required: false + - type: textarea id: suggestion_description attributes: @@ -35,6 +28,7 @@ body: placeholder: "Explain your idea in detail" validations: required: true + - type: dropdown id: priority attributes: @@ -46,6 +40,7 @@ body: - "High" validations: required: true + - type: textarea id: alternatives attributes: @@ -54,6 +49,7 @@ body: placeholder: "Mention any alternative approaches" validations: required: false + - type: textarea id: additional_context attributes: From adda4b092df57a4bf465ec166e0525217e47c55e Mon Sep 17 00:00:00 2001 From: hwangsihu Date: Thu, 10 Oct 2024 22:05:58 +0900 Subject: [PATCH 6/6] Update package --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 229735230..cbdb1a76e 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/signale": "^1.4.7", "prisma": "^5.20.0", "tslib": "^2.7.0", - "typescript": "^5.6.2" + "typescript": "^5.6.3" }, "dependencies": { "@prisma/client": "^5.20.0", @@ -52,7 +52,7 @@ "node-system-stats": "^1.3.0", "signale": "^1.4.0", "topgg-autoposter": "^2.0.2", - "undici": "^6.19.8", + "undici": "^6.20.0", "zod": "^3.23.8" }, "signale": {