Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update package, config, issue template and format #743

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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}]
5 changes: 3 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -44,6 +44,7 @@ body:
placeholder: "e.g., 14.17.0"
validations:
required: true

- type: input
id: java-version
attributes:
Expand Down Expand Up @@ -74,4 +75,4 @@ body:
attributes:
label: "Additional context"
description: "Provide any other context or information that might be helpful."
placeholder: "Any additional details..."
placeholder: "Any additional details..."
14 changes: 5 additions & 9 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -27,6 +19,7 @@ body:
placeholder: "Describe the problem"
validations:
required: false

- type: textarea
id: suggestion_description
attributes:
Expand All @@ -35,6 +28,7 @@ body:
placeholder: "Explain your idea in detail"
validations:
required: true

- type: dropdown
id: priority
attributes:
Expand All @@ -46,6 +40,7 @@ body:
- "High"
validations:
required: true

- type: textarea
id: alternatives
attributes:
Expand All @@ -54,6 +49,7 @@ body:
placeholder: "Mention any alternative approaches"
validations:
required: false

- type: textarea
id: additional_context
attributes:
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
},
"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/node": "^22.7.5",
"@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",
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/env.ts
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you know about preprocess ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've heard about it, but I don't know the details lol. But if we remove this, it would be good because we wouldn't need to use quotation marks. Am I mistaken?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to stop doing this kind of thing, if we put that it is for a reason, I asked you to test before making PR!

Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
8 changes: 4 additions & 4 deletions src/events/client/VoiceStateUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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;

Expand All @@ -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);
}
}
},
Expand Down
48 changes: 24 additions & 24 deletions src/events/player/PlayerDestroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
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<void> {
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<string | undefined>('messageId');
if (!messageId) return;
const messageId = player.get<string | undefined>('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;
});
}
}
}

/**
Expand Down
48 changes: 24 additions & 24 deletions src/events/player/PlayerDisconnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
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<void> {
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<string | undefined>('messageId');
if (!messageId) return;
const messageId = player.get<string | undefined>('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;
});
}
}
}

/**
Expand Down