follow deprecation notices
All checks were successful
PR Check / lint-and-format (pull_request) Successful in 39s
All checks were successful
PR Check / lint-and-format (pull_request) Successful in 39s
This commit is contained in:
parent
9be710ef24
commit
572d5ec167
11 changed files with 56 additions and 38 deletions
|
@ -5,6 +5,7 @@ import {
|
|||
Client,
|
||||
Message,
|
||||
MessageComponentInteraction,
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import { getLocale } from "../utils/locales";
|
||||
|
||||
|
@ -58,7 +59,7 @@ export const collect = (
|
|||
if (!button) {
|
||||
interaction.reply({
|
||||
content: loc.get("e_interacreate_no_button"),
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import {
|
|||
Colors,
|
||||
CommandInteraction,
|
||||
EmbedBuilder,
|
||||
MessageFlags,
|
||||
NonThreadGuildBasedChannel,
|
||||
} from "discord.js";
|
||||
import "../../modules/string";
|
||||
|
@ -66,7 +67,7 @@ export default {
|
|||
// Category doesn't exist or is not included
|
||||
return interaction.reply({
|
||||
content: `${loc.get("c_archive3")} \`${desiredCat}\``,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import {
|
|||
Client,
|
||||
Colors,
|
||||
EmbedBuilder,
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import "../../modules/string";
|
||||
import { getLocale, getLocalizations } from "../../utils/locales";
|
||||
|
@ -110,13 +111,13 @@ export default {
|
|||
|
||||
const command = NameNotLocalized(client, possible_command);
|
||||
if (!command) {
|
||||
return interaction.reply({ content: error, ephemeral: true });
|
||||
return interaction.reply({ content: error, flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
|
||||
const scope = client.commands.list.get(command.name)?.scope();
|
||||
if (scope!.length > 0 && scope?.find((id) => id === interaction.guildId) === undefined) {
|
||||
// Command not available for the current guild
|
||||
return interaction.reply({ content: error, ephemeral: true });
|
||||
return interaction.reply({ content: error, flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
|
||||
let subcommand = undefined;
|
||||
|
@ -128,7 +129,7 @@ export default {
|
|||
|
||||
if (!command || subcommand === undefined) {
|
||||
// Sub/Command don't exist
|
||||
return interaction.reply({ content: error, ephemeral: true });
|
||||
return interaction.reply({ content: error, flags: [MessageFlags.Ephemeral] });
|
||||
}
|
||||
|
||||
// Loads the data according to the user's locals
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction, Client, Message } from "discord.js";
|
||||
import { ChatInputCommandInteraction, Client } from "discord.js";
|
||||
import { getLocale, getLocalizations } from "../../utils/locales";
|
||||
import { getFilename } from "../../utils/misc";
|
||||
|
||||
|
@ -18,14 +18,14 @@ export default {
|
|||
interaction: async (interaction: ChatInputCommandInteraction, client: Client) => {
|
||||
const loc = getLocale(client, interaction.locale);
|
||||
|
||||
const sent = (await interaction.reply({
|
||||
const sent = await interaction.reply({
|
||||
content: "Pinging...",
|
||||
fetchReply: true,
|
||||
})) as Message;
|
||||
withResponse: true,
|
||||
});
|
||||
|
||||
interaction.editReply(
|
||||
`${loc?.get("c_ping1")}: \
|
||||
${sent.createdTimestamp - interaction.createdTimestamp}ms
|
||||
${sent.resource!.message!.createdTimestamp - interaction.createdTimestamp}ms
|
||||
${loc?.get("c_ping2")}: ${client.ws.ping}ms.`,
|
||||
);
|
||||
},
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChannelType, Client, Colors, CommandInteraction, EmbedBuilder } from "discord.js";
|
||||
import {
|
||||
ChannelType,
|
||||
Client,
|
||||
Colors,
|
||||
CommandInteraction,
|
||||
EmbedBuilder,
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import "../../modules/string";
|
||||
import { getLocale, getLocalizations } from "../../utils/locales";
|
||||
import { getFilename } from "../../utils/misc";
|
||||
|
@ -59,7 +66,7 @@ export default {
|
|||
// Category doesn't exist or is not allowed
|
||||
return interaction.reply({
|
||||
content: `${loc.get("c_prep3")} \`${desired_cat}\``,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import {
|
|||
ButtonStyle,
|
||||
ChatInputCommandInteraction,
|
||||
Client,
|
||||
MessageFlags,
|
||||
ModalBuilder,
|
||||
TextInputBuilder,
|
||||
TextInputStyle,
|
||||
|
@ -162,13 +163,13 @@ export default {
|
|||
.then((msg) =>
|
||||
interaction.reply({
|
||||
content: msg as string,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
}),
|
||||
)
|
||||
.catch((err) => {
|
||||
interaction.reply({
|
||||
content: err,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
});
|
||||
} else {
|
||||
|
@ -233,16 +234,16 @@ export default {
|
|||
.setStyle(ButtonStyle.Primary),
|
||||
);
|
||||
|
||||
const message = await interaction.reply({
|
||||
ephemeral: true,
|
||||
const callback = await interaction.reply({
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
embeds: [list],
|
||||
components: [row],
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
|
||||
// Buttons interactions
|
||||
collect(client, interaction, idPrec, message);
|
||||
collect(client, interaction, idNext, message);
|
||||
collect(client, interaction, idPrec, callback.resource!.message!);
|
||||
collect(client, interaction, idNext, callback.resource!.message!);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -254,7 +255,7 @@ export default {
|
|||
if (id === null) {
|
||||
return interaction.reply({
|
||||
content: loc.get(`c_${filename}2`),
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -264,7 +265,7 @@ export default {
|
|||
) {
|
||||
return interaction.reply({
|
||||
content: loc.get(`c_${filename}3`),
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -276,7 +277,7 @@ export default {
|
|||
return deleteReminder(client, reminderInfo.creation_date, reminderInfo.user_id).then(() =>
|
||||
interaction.reply({
|
||||
content: `Reminder **#${id}** supprimé !`,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { useMainPlayer, useQueue } from "discord-player";
|
||||
import { ChatInputCommandInteraction, Client, EmbedBuilder, Message } from "discord.js";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
Client,
|
||||
EmbedBuilder,
|
||||
Message,
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import { getLocale, getLocalizations } from "../../utils/locales";
|
||||
import { getFilename } from "../../utils/misc";
|
||||
import { discord_limit_message } from "../../utils/constants";
|
||||
|
@ -90,7 +96,7 @@ export default {
|
|||
await interaction.deferReply();
|
||||
|
||||
const player = useMainPlayer();
|
||||
const queue = useQueue(interaction.guildId!);
|
||||
const queue = useQueue();
|
||||
if (request) {
|
||||
if (
|
||||
interaction.options.getSubcommand() ===
|
||||
|
@ -110,7 +116,7 @@ export default {
|
|||
if (track) {
|
||||
try {
|
||||
data = await player.lyrics.search({
|
||||
q: track.cleanTitle + " " + queue.history.currentTrack?.author,
|
||||
q: track.author + " " + track.cleanTitle,
|
||||
});
|
||||
} catch {
|
||||
return await interaction.followUp(`❌ | ${loc.get("c_lyrics2")} \`${track.title}\``);
|
||||
|
@ -169,7 +175,7 @@ export default {
|
|||
|
||||
return await interaction.followUp({
|
||||
content: `🎤 | ${loc.get("c_lyrics4")}`,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import {
|
|||
ChatInputCommandInteraction,
|
||||
Client,
|
||||
EmbedBuilder,
|
||||
MessageFlags,
|
||||
} from "discord.js";
|
||||
import { getLocale, getLocalizations } from "../../utils/locales";
|
||||
import { Metadata } from "../../utils/metadata";
|
||||
|
@ -84,7 +85,7 @@ export default {
|
|||
if (!member?.voice.channelId) {
|
||||
return await interaction.reply({
|
||||
content: `❌ | ${loc.get("c_play1")}`,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -94,7 +95,7 @@ export default {
|
|||
) {
|
||||
return await interaction.reply({
|
||||
content: `❌ | ${loc.get("c_play2")} ${interaction.guild.members.me.voice.channel}`,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -142,7 +143,7 @@ export default {
|
|||
queue.delete();
|
||||
return await interaction.reply({
|
||||
content: `❌ | ${loc.get("c_play3")}`,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -127,15 +127,15 @@ export default {
|
|||
),
|
||||
);
|
||||
|
||||
const message = await interaction.reply({
|
||||
const callback = await interaction.reply({
|
||||
embeds: [embed],
|
||||
components: rows,
|
||||
fetchReply: true,
|
||||
withResponse: true,
|
||||
});
|
||||
|
||||
// Buttons interactions
|
||||
collect(client, interaction, idPrec, message);
|
||||
collect(client, interaction, idNext, message);
|
||||
collect(client, interaction, idPrec, callback.resource!.message!);
|
||||
collect(client, interaction, idNext, callback.resource!.message!);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Client, Interaction, InteractionType } from "discord.js";
|
||||
import { Client, Interaction, InteractionType, MessageFlags } from "discord.js";
|
||||
import { getLocale } from "../../utils/locales";
|
||||
import { useMainPlayer } from "discord-player";
|
||||
|
||||
|
@ -11,7 +11,7 @@ export default (interaction: Interaction, client: Client) => {
|
|||
if (!command) {
|
||||
return interaction.reply({
|
||||
content: loc.get("e_interacreate_no_command"),
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ export default (interaction: Interaction, client: Client) => {
|
|||
if (!modal) {
|
||||
return interaction.reply({
|
||||
content: loc.get("e_interacreate_no_modal"),
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Client, ModalSubmitInteraction } from "discord.js";
|
||||
import { Client, MessageFlags, ModalSubmitInteraction } from "discord.js";
|
||||
import { getFilename } from "../../utils/misc";
|
||||
import { newReminder } from "../../utils/commands/reminder";
|
||||
|
||||
|
@ -19,7 +19,7 @@ export default {
|
|||
}).then((msg) =>
|
||||
interaction.reply({
|
||||
content: msg as string,
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
}),
|
||||
);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue