=== instead of ==
This commit is contained in:
parent
b316734511
commit
a9163f110b
11 changed files with 27 additions and 27 deletions
|
@ -23,7 +23,7 @@ export default {
|
|||
// Retrieve Pages
|
||||
const pageMax = Number(/(\d+)(?!.*\d)/gm.exec(embed_desc)?.[0]);
|
||||
let page = Number(/(?!• \s+)\d(?=\/)/gm.exec(embed_desc)?.[0]);
|
||||
if (page - 1 == 0) {
|
||||
if (page - 1 === 0) {
|
||||
page = pageMax;
|
||||
} else {
|
||||
page--;
|
||||
|
|
|
@ -24,7 +24,7 @@ export default {
|
|||
// Retrieve Pages
|
||||
const pageMax = Number(/(\d+)(?!.*\d)/gm.exec(embed_desc)?.[0]);
|
||||
let page = Number(/(?!• \s+)\d(?=\/)/gm.exec(embed_desc)?.[0]);
|
||||
if (page - 1 == 0) {
|
||||
if (page - 1 === 0) {
|
||||
page = pageMax;
|
||||
} else {
|
||||
page--;
|
||||
|
|
|
@ -70,7 +70,7 @@ export default async (client: Client) => {
|
|||
);
|
||||
|
||||
// Send global commands to Discord
|
||||
const globalCommands = commands.filter((c) => c.scope().length == 0);
|
||||
const globalCommands = commands.filter((c) => c.scope().length === 0);
|
||||
return await rest.put(Routes.applicationCommands(client.user?.id as string), {
|
||||
body: globalCommands.map((c) => c.data.toJSON()),
|
||||
});
|
||||
|
|
|
@ -74,14 +74,14 @@ export default {
|
|||
allChannel?.then(async (channelGuild) => {
|
||||
// Retrieve category to archive
|
||||
const catToArchive = channelGuild
|
||||
.filter((chan) => chan?.type == ChannelType.GuildCategory)
|
||||
.filter((chan) => chan?.name == desiredCat);
|
||||
.filter((chan) => chan?.type === ChannelType.GuildCategory)
|
||||
.filter((chan) => chan?.name === desiredCat);
|
||||
|
||||
// Create/Retrieve the archive category
|
||||
const catArchivedName = "archive - " + desiredCat;
|
||||
const catArchivedMap = channelGuild
|
||||
.filter((chan) => chan?.type == ChannelType.GuildCategory)
|
||||
.filter((chan) => chan?.name == catArchivedName);
|
||||
.filter((chan) => chan?.type === ChannelType.GuildCategory)
|
||||
.filter((chan) => chan?.name === catArchivedName);
|
||||
|
||||
let catArchived: NonThreadGuildBasedChannel | null | undefined;
|
||||
if (catArchivedMap.size > 0) {
|
||||
|
@ -94,11 +94,11 @@ export default {
|
|||
}
|
||||
|
||||
const allChannelDesired = channelGuild
|
||||
.filter((chan) => chan?.type == 0)
|
||||
.filter((chan) => chan?.parentId == catToArchive.map((cat) => cat?.id)[0]);
|
||||
.filter((chan) => chan?.type === 0)
|
||||
.filter((chan) => chan?.parentId === catToArchive.map((cat) => cat?.id)[0]);
|
||||
|
||||
// If no channels in the source category
|
||||
if (allChannelDesired.size == 0) {
|
||||
if (allChannelDesired.size === 0) {
|
||||
return interaction.reply({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
|
|
|
@ -67,21 +67,21 @@ export default {
|
|||
const allChannel = interaction.guild?.channels.fetch();
|
||||
allChannel?.then((channel_guild) => {
|
||||
const cat_to_prep = channel_guild
|
||||
.filter((chan) => chan?.type == ChannelType.GuildCategory)
|
||||
.filter((chan) => chan?.name == desired_cat);
|
||||
.filter((chan) => chan?.type === ChannelType.GuildCategory)
|
||||
.filter((chan) => chan?.name === desired_cat);
|
||||
const cat_to_prep_id = cat_to_prep.map((cat) => cat?.id);
|
||||
const cat_to_prep_name = cat_to_prep.map((cat) => cat?.name);
|
||||
|
||||
// console.log(cat_to_prep);
|
||||
const all_channel_desired = channel_guild
|
||||
.filter((chan) => chan?.type == 0)
|
||||
.filter((chan) => chan?.parentId == cat_to_prep_id[0]);
|
||||
.filter((chan) => chan?.type === 0)
|
||||
.filter((chan) => chan?.parentId === cat_to_prep_id[0]);
|
||||
const all_channel_desired_name = all_channel_desired.map((c_d) => c_d?.name);
|
||||
|
||||
let desc = "";
|
||||
|
||||
const general = "général";
|
||||
if (all_channel_desired_name.filter((cdn) => cdn == general).length == 0) {
|
||||
if (all_channel_desired_name.filter((cdn) => cdn === general).length === 0) {
|
||||
interaction.guild?.channels.create({
|
||||
name: general,
|
||||
type: 0,
|
||||
|
@ -91,7 +91,7 @@ export default {
|
|||
}
|
||||
|
||||
const info = "informations";
|
||||
if (all_channel_desired_name.filter((cdn) => cdn == info).length == 0) {
|
||||
if (all_channel_desired_name.filter((cdn) => cdn === info).length === 0) {
|
||||
interaction.guild?.channels.create({
|
||||
name: info,
|
||||
type: 0,
|
||||
|
@ -101,7 +101,7 @@ export default {
|
|||
desc += "`" + info + "` " + loc.get("c_prep5") + "\n";
|
||||
}
|
||||
|
||||
if (desc == "") {
|
||||
if (desc === "") {
|
||||
desc = loc.get("c_prep6");
|
||||
}
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ export default {
|
|||
let user = interaction.options.getUser(
|
||||
loc_default?.get(`c_${filename}_sub2_opt1_name`) as string,
|
||||
);
|
||||
if (user == null) {
|
||||
if (user === null) {
|
||||
user = interaction.user;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
const queue = useQueue(interaction.guildId!);
|
||||
if (request) {
|
||||
if (
|
||||
interaction.options.getSubcommand() ==
|
||||
interaction.options.getSubcommand() ===
|
||||
loc_default?.get(`c_${filename}_sub2_name`)?.toLowerCase()
|
||||
) {
|
||||
// Romanized
|
||||
|
@ -111,7 +111,7 @@ export default {
|
|||
}
|
||||
|
||||
if (
|
||||
interaction.options.getSubcommand() ==
|
||||
interaction.options.getSubcommand() ===
|
||||
loc_default?.get(`c_${filename}_sub3_name`)?.toLowerCase()
|
||||
) {
|
||||
if (queue === null) {
|
||||
|
|
|
@ -26,7 +26,7 @@ export default async (client: Client) => {
|
|||
throw `Unknown file in ${event_category}: ${event_file}`;
|
||||
}
|
||||
|
||||
if (event_category == "player") {
|
||||
if (event_category === "player") {
|
||||
const player = useMainPlayer() as Player;
|
||||
if (once) {
|
||||
// eslint-disable-next-line
|
||||
|
|
|
@ -82,7 +82,7 @@ export default async (message: Message, client: Client) => {
|
|||
// If message doesn't exist or empty
|
||||
if (
|
||||
!quoted_message ||
|
||||
(!quoted_message.content && quoted_message.attachments.size == 0)
|
||||
(!quoted_message.content && quoted_message.attachments.size === 0)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ export default async (message: Message, client: Client) => {
|
|||
}
|
||||
|
||||
let author = "Auteur";
|
||||
if (message.author == quoted_post?.author) {
|
||||
if (message.author === quoted_post?.author) {
|
||||
author += " & Citateur";
|
||||
} else {
|
||||
footer += `\nCité par ${userWithNickname(message.member as GuildMember) ?? "?"} le ${showDate(
|
||||
|
|
|
@ -25,10 +25,10 @@ export const embedListQueue = (
|
|||
embed.setFooter({ text: `${printRepeatMode(queue.repeatMode, loc)}` });
|
||||
|
||||
tracks.slice((page - 1) * limit_fields, page * limit_fields).forEach((t, idx) => {
|
||||
const now_playing = idx == 0 && page == 1;
|
||||
const now_playing = idx === 0 && page === 1;
|
||||
const name = now_playing
|
||||
? loc.get("c_queue10")
|
||||
: (idx == 1 && page == 1) || (idx == 0 && page > 1)
|
||||
: (idx === 1 && page === 1) || (idx === 0 && page > 1)
|
||||
? loc.get("c_queue11")
|
||||
: "\u200b";
|
||||
const idx_track = now_playing ? "" : `${idx + limit_fields * (page - 1)}. `;
|
||||
|
|
|
@ -166,7 +166,7 @@ export const sendReminder = (client: Client, info: infoReminder, option: OptionR
|
|||
}
|
||||
}
|
||||
|
||||
if (option == OptionReminder.DirectMessage || !channelOk || !guildOk) {
|
||||
if (option === OptionReminder.DirectMessage || !channelOk || !guildOk) {
|
||||
// Direct message
|
||||
const user = client.users.cache.get(info.userId);
|
||||
if (user !== undefined) {
|
||||
|
@ -182,7 +182,7 @@ export const sendReminder = (client: Client, info: infoReminder, option: OptionR
|
|||
});
|
||||
|
||||
// Mention everybody if needed
|
||||
if (option == OptionReminder.Mention) {
|
||||
if (option === OptionReminder.Mention) {
|
||||
(info.message?.match(/<@\d+>/g) ?? []).forEach((mention) => {
|
||||
content += " " + mention;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue