Skip to content
Merged
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
3 changes: 2 additions & 1 deletion src/buttons/Queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
EmbedBuilder,
InteractionCollector,
Message,
MessageFlags,
} from 'discord.js'
import { PlayerButton } from '../@types/Button.js'
import { Manager } from '../manager.js'
Expand Down Expand Up @@ -72,6 +73,6 @@ export default class implements PlayerButton {

pages.push(embed)
}
message.reply({ embeds: [pages[0]], ephemeral: true })
message.reply({ embeds: [pages[0]], flags: MessageFlags.Ephemeral })
}
}
3 changes: 2 additions & 1 deletion src/buttons/Shuffle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
EmbedBuilder,
InteractionCollector,
Message,
MessageFlags,
User,
} from 'discord.js'
import { PlayerButton } from '../@types/Button.js'
Expand Down Expand Up @@ -104,6 +105,6 @@ export default class implements PlayerButton {
message,
qduration
)
} else message.reply({ embeds: [pages[0]], ephemeral: true })
} else message.reply({ embeds: [pages[0]], flags: MessageFlags.Ephemeral })
}
}
4 changes: 2 additions & 2 deletions src/commands/Music/Insert.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ApplicationCommandOptionType,
AutocompleteInteraction,
CommandInteraction,
ChatInputCommandInteraction,
EmbedBuilder,
} from 'discord.js'
import { Manager } from '../../manager.js'
Expand Down Expand Up @@ -133,7 +133,7 @@ export default class implements Command {
// Autocomplete function
async autocomplete(client: Manager, interaction: GlobalInteraction, language: string) {
let choice: AutocompleteInteractionChoices[] = []
const url = String((interaction as CommandInteraction).options.get('search')!.value)
const url = String((interaction as ChatInputCommandInteraction).options.get('search')!.value)

const Random =
client.config.player.AUTOCOMPLETE_SEARCH[
Expand Down
4 changes: 2 additions & 2 deletions src/commands/Music/Play.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ApplicationCommandOptionType,
AutocompleteInteraction,
CommandInteraction,
ChatInputCommandInteraction,
EmbedBuilder,
} from 'discord.js'
import { convertTime } from '../../utilities/ConvertTime.js'
Expand Down Expand Up @@ -183,7 +183,7 @@ export default class implements Command {
// Autocomplete function
async autocomplete(client: Manager, interaction: GlobalInteraction, language: string) {
let choice: AutocompleteInteractionChoices[] = []
const url = String((interaction as CommandInteraction).options.get('search')!.value)
const url = String((interaction as ChatInputCommandInteraction).options.get('search')!.value)

const maxLength = await client.db.maxlength.get(interaction.user.id)

Expand Down
3 changes: 2 additions & 1 deletion src/commands/Music/Radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ApplicationCommandOptionType,
ComponentType,
EmbedBuilder,
MessageFlags,
StringSelectMenuBuilder,
StringSelectMenuOptionBuilder,
} from 'discord.js'
Expand Down Expand Up @@ -165,7 +166,7 @@ export default class implements Command {
const msgReply = await message
.reply({
embeds: [replyEmbed],
ephemeral: true,
flags: MessageFlags.Ephemeral,
})
.catch(() => {})
if (msgReply)
Expand Down
4 changes: 2 additions & 2 deletions src/commands/Playlist/Add.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
EmbedBuilder,
ApplicationCommandOptionType,
CommandInteraction,
ChatInputCommandInteraction,
AutocompleteInteraction,
} from 'discord.js'
import { convertTime } from '../../utilities/ConvertTime.js'
Expand Down Expand Up @@ -220,7 +220,7 @@ export default class implements Command {
// Autocomplete function
public async autocomplete(client: Manager, interaction: GlobalInteraction, language: string) {
let choice: AutocompleteInteractionChoices[] = []
const url = String((interaction as CommandInteraction).options.get('search')!.value)
const url = String((interaction as ChatInputCommandInteraction).options.get('search')!.value)

const maxLength = await client.db.maxlength.get(interaction.user.id)

Expand Down
8 changes: 4 additions & 4 deletions src/commands/Playlist/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
EmbedBuilder,
ApplicationCommandOptionType,
Message,
CommandInteraction,
ChatInputCommandInteraction,
ActionRowBuilder,
TextInputBuilder,
ModalBuilder,
Expand Down Expand Up @@ -42,7 +42,7 @@ export default class implements Command {
if (handler.message) {
await this.prefixMode(client, handler.message, handler.args, handler.language, handler.prefix)
} else if (handler.interaction) {
await this.interactionMode(client, handler.interaction, handler.language)
await this.interactionMode(client, handler.interaction as ChatInputCommandInteraction, handler.language)
} else return
}

Expand Down Expand Up @@ -259,7 +259,7 @@ export default class implements Command {
// Interaction mode
private async interactionMode(
client: Manager,
interaction: CommandInteraction,
interaction: ChatInputCommandInteraction,
language: string
) {
const playlistId = new TextInputBuilder()
Expand Down Expand Up @@ -314,7 +314,7 @@ export default class implements Command {
new ActionRowBuilder<TextInputBuilder>().addComponents(playlistPrivate)
)

const value = (interaction.options as CommandInteractionOptionResolver).getString('id')
const value = (interaction as ChatInputCommandInteraction).options.getString('id')
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The type cast on this line is redundant since the interaction parameter is already typed as ChatInputCommandInteraction in the function signature. You can simplify this to: const value = interaction.options.getString('id')

Suggested change
const value = (interaction as ChatInputCommandInteraction).options.getString('id')
const value = interaction.options.getString('id')

Copilot uses AI. Check for mistakes.

const playlist = await client.db.playlist.get(value!)

Expand Down
5 changes: 4 additions & 1 deletion src/events/guild/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ export default class {
return
}
const escapeRegex = (str: string) => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
const prefixRegex = new RegExp(`^(<@!?${client.user!.id}>|${escapeRegex(PREFIX.toLowerCase())})\\s*`, 'i')
const prefixRegex = new RegExp(
`^(<@!?${client.user!.id}>|${escapeRegex(PREFIX.toLowerCase())})\\s*`,
'i'
)
if (!prefixRegex.test(message.content)) return
const [matchedPrefix] = message.content.match(prefixRegex) as RegExpMatchArray
const args = message.content.slice(matchedPrefix.length).trim().split(/ +/g)
Expand Down
6 changes: 3 additions & 3 deletions src/events/track/trackStart.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Manager } from '../../manager.js'
import { ComponentType, TextChannel } from 'discord.js'
import { ComponentType, TextChannel, MessageFlags } from 'discord.js'
import { EmbedBuilder } from 'discord.js'
import { formatDuration } from '../../utilities/FormatDuration.js'
import { filterSelect, playerRowOne, playerRowTwo } from '../../utilities/PlayerControlButton.js'
Expand Down Expand Up @@ -142,7 +142,7 @@ export default class {
else {
message.reply({
content: `${client.i18n.get(language, 'event.player', 'join_voice')}`,
ephemeral: true,
flags: MessageFlags.Ephemeral,
})
return false
}
Expand All @@ -160,7 +160,7 @@ export default class {
else {
message.reply({
content: `${client.i18n.get(language, 'event.player', 'join_voice')}`,
ephemeral: true,
flags: MessageFlags.Ephemeral,
})
return false
}
Expand Down
3 changes: 1 addition & 2 deletions src/services/ReplyInteractionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ export class ReplyInteractionService {
const msg = await this.message
.reply({
embeds: [embed],
ephemeral: false,
})
.catch(() => null)
const setup = await this.client.db.setup.get(String(this.message.guildId))

setTimeout(() => {
(!setup || setup == null || setup.channel !== this.message.channelId) && msg
;(!setup || setup == null || setup.channel !== this.message.channelId) && msg
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Variable 'setup' cannot be of type null, but it is compared to an expression of type null.

Suggested change
;(!setup || setup == null || setup.channel !== this.message.channelId) && msg
;(!setup || setup.channel !== this.message.channelId) && msg

Copilot uses AI. Check for mistakes.
? msg.delete().catch(() => null)
: true
}, this.client.config.utilities.DELETE_MSG_TIMEOUT)
Expand Down
2 changes: 1 addition & 1 deletion src/structures/CommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class CommandHandler {

public async deferReply() {
if (this.interaction) {
const data = await this.interaction.deferReply({ ephemeral: false })
const data = await this.interaction.deferReply()
return (this.msg = data)
} else {
const data = await this.message?.reply(`**${this.client.user?.username}** is thinking...`)
Expand Down
3 changes: 2 additions & 1 deletion src/structures/PageQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ComponentType,
EmbedBuilder,
Message,
MessageFlags,
} from 'discord.js'
import { Manager } from '../manager.js'

Expand Down Expand Up @@ -425,7 +426,7 @@ export class PageQueue {
],
components: [row],
allowedMentions: { repliedUser: false },
ephemeral: true,
flags: MessageFlags.Ephemeral,
})
if (this.pages.length == 0) return

Expand Down
Loading