diff --git a/src/commands/info/Help.ts b/src/commands/info/Help.ts index 499f0e7b3..65400ea36 100644 --- a/src/commands/info/Help.ts +++ b/src/commands/info/Help.ts @@ -62,7 +62,7 @@ export default class Help extends Command { .setDescription( ctx.locale('cmd.help.help_cmd', { description: ctx.locale(command.description.content), - usage: `${guild.prefix}${command.description.usage}`, + usage: `${guild?.prefix}${command.description.usage}`, examples: command.description.examples.map((example: string) => `${guild.prefix}${example}`).join(', '), aliases: command.aliases.map((alias: string) => `\`${alias}\``).join(', '), category: command.category, diff --git a/src/commands/music/Lyrics.ts b/src/commands/music/Lyrics.ts.txt similarity index 99% rename from src/commands/music/Lyrics.ts rename to src/commands/music/Lyrics.ts.txt index c4ff1cf69..4273611ae 100644 --- a/src/commands/music/Lyrics.ts +++ b/src/commands/music/Lyrics.ts.txt @@ -1,4 +1,4 @@ -import { +/* import { ActionRowBuilder, ButtonBuilder, type ButtonInteraction, @@ -173,6 +173,7 @@ export default class Lyrics extends Command { return pages; } } +*/ /** * Project: lavamusic @@ -183,4 +184,4 @@ export default class Lyrics extends Command { * This code is the property of Coder and may not be reproduced or * modified without permission. For more information, contact us at * https://discord.gg/ns8CTk9J3e - */ + */ \ No newline at end of file diff --git a/src/database/server.ts b/src/database/server.ts index a023c695c..6f3a4248e 100644 --- a/src/database/server.ts +++ b/src/database/server.ts @@ -8,7 +8,7 @@ export default class ServerData { this.prisma = new PrismaClient(); } - public async get(guildId: string): Promise { + public async get(guildId: string): Promise { return (await this.prisma.guild.findUnique({ where: { guildId } })) ?? this.createGuild(guildId); } @@ -74,9 +74,12 @@ export default class ServerData { await this.prisma.stay.delete({ where: { guildId } }); } - public async get_247(guildId?: string): Promise { + public async get_247(guildId?: string): Promise { if (guildId) { - return await this.prisma.stay.findUnique({ where: { guildId } }); + //return await this.prisma.stay.findUnique({ where: { guildId } }); + const stay = await this.prisma.stay.findUnique({ where: { guildId } }); + if (stay) return stay; + return null; } return this.prisma.stay.findMany(); } @@ -219,7 +222,7 @@ export default class ServerData { public async removeSong(userId: string, playlistName: string, encodedSong: string): Promise { const playlist = await this.getPlaylist(userId, playlistName); if (playlist) { - const tracks: string[] = JSON.parse(playlist.tracks); + const tracks: string[] = JSON.parse(playlist?.tracks!); // Find the index of the song to remove const songIndex = tracks.indexOf(encodedSong); @@ -259,7 +262,7 @@ export default class ServerData { } // Deserialize the tracks JSON string back into an array - const tracks = JSON.parse(playlist.tracks); + const tracks = JSON.parse(playlist.tracks!); return tracks; } } diff --git a/src/events/client/MessageCreate.ts b/src/events/client/MessageCreate.ts index 94ea9db45..ef36a26d4 100644 --- a/src/events/client/MessageCreate.ts +++ b/src/events/client/MessageCreate.ts @@ -34,7 +34,7 @@ export default class MessageCreate extends Event { if (mention.test(message.content)) { await message.reply({ content: T(locale, 'event.message.prefix_mention', { - prefix: guild.prefix, + prefix: guild?.prefix, }), }); return; diff --git a/src/events/client/SetupButtons.ts b/src/events/client/SetupButtons.ts index 7d16a541f..7b6c5b0b8 100644 --- a/src/events/client/SetupButtons.ts +++ b/src/events/client/SetupButtons.ts @@ -48,7 +48,7 @@ export default class SetupButtons extends Event { const { title, uri, duration, artworkUrl, sourceName, isStream } = player.queue.current.info; let message: Message | undefined; try { - message = await interaction.channel.messages.fetch(data.messageId, { + message = await interaction.channel.messages.fetch(data?.messageId, { cache: true, }); } catch (_e) { diff --git a/src/events/client/SetupSystem.ts b/src/events/client/SetupSystem.ts index cc8fbb446..047dbaf1a 100644 --- a/src/events/client/SetupSystem.ts +++ b/src/events/client/SetupSystem.ts @@ -1,4 +1,4 @@ -import { type Message, PermissionsBitField, TextChannel } from 'discord.js'; +import { type Message, TextChannel } from 'discord.js'; import { T } from '../../structures/I18n'; import { Event, type Lavamusic } from '../../structures/index'; import { oops, setupStart } from '../../utils/SetupSystem';