Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
.

.
  • Loading branch information
hwangsihu committed Oct 18, 2024
1 parent ec3e555 commit 7635502
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 56 deletions.
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.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
},
"homepage": "https://github.com/appujet/lavamusic#readme",
"devDependencies": {
"@biomejs/biome": "^1.9.3",
"@biomejs/biome": "^1.9.4",
"@types/i18n": "^0.13.12",
"@types/node": "^22.7.6",
"@types/signale": "^1.4.7",
"prisma": "^5.21.0",
"prisma": "^5.21.1",
"typescript": "^5.6.3"
},
"dependencies": {
"@prisma/client": "^5.21.0",
"@prisma/client": "^5.21.1",
"@top-gg/sdk": "^3.1.6",
"discord.js": "^14.16.3",
"dotenv": "^16.4.5",
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

0 comments on commit 7635502

Please sign in to comment.