I hereby decree that this document shall no longer contain the substring " == ", and hereafter shall be referred to as " === ". This amendment shall take effect immediately.
Signed-off-by: pineafan <pineapplefanyt@gmail.com>
diff --git a/src/reflex/guide.ts b/src/reflex/guide.ts
index 39974e7..517d7f4 100644
--- a/src/reflex/guide.ts
+++ b/src/reflex/guide.ts
@@ -1,3 +1,4 @@
+import { LoadingEmbed } from './../utils/defaultEmbeds.js';
import { SelectMenuOption } from '@discordjs/builders';
import Discord, { MessageActionRow, MessageButton } from "discord.js";
import EmojiEmbed from "../utils/generateEmojiEmbed.js";
@@ -126,23 +127,8 @@
).setTitle("Premium").setDescription("Premium features").setPageId(7),
]
let m;
- if (interaction) {
- m = await interaction.reply({embeds: [
- new EmojiEmbed()
- .setTitle("Welcome")
- .setDescription(`One moment...`)
- .setStatus("Danger")
- .setEmoji("NUCLEUS.LOADING")
- ], fetchReply: true, ephemeral: true});
- } else {
- m = await c.send({embeds: [
- new EmojiEmbed()
- .setTitle("Welcome")
- .setDescription(`One moment...`)
- .setStatus("Danger")
- .setEmoji("NUCLEUS.LOADING")
- ], fetchReply: true });
- }
+ if (interaction) { m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true}); }
+ else { m = await c.send({embeds: LoadingEmbed }); }
let page = 0;
let f = async (component) => {
@@ -174,8 +160,7 @@
let components = selectPane.concat([new MessageActionRow().addComponents([
new MessageButton().setCustomId("left").setEmoji(getEmojiByName("CONTROL.LEFT", "id")).setStyle("SECONDARY").setDisabled(page === 0),
new MessageButton().setCustomId("select").setEmoji(getEmojiByName("CONTROL.MENU", "id")).setStyle(selectPaneOpen ? "PRIMARY" : "SECONDARY").setDisabled(false),
- new MessageButton().setCustomId("right").setEmoji(getEmojiByName("CONTROL.RIGHT", "id")).setStyle("SECONDARY").setDisabled(page === pages.length - 1),
- new MessageButton().setCustomId("close").setEmoji(getEmojiByName("CONTROL.CROSS", "id")).setStyle("DANGER")
+ new MessageButton().setCustomId("right").setEmoji(getEmojiByName("CONTROL.RIGHT", "id")).setStyle("SECONDARY").setDisabled(page === pages.length - 1)
])])
if (interaction) {
let em = new Discord.MessageEmbed(pages[page].embed)
@@ -198,56 +183,53 @@
i = await m.awaitMessageComponent({filter: interaction ? () => { return true } : f, time: 300000});
} catch(e) { break }
i.deferUpdate()
- if (i.component.customId == "left") {
+ if (i.component.customId === "left") {
if (page > 0) page--;
selectPaneOpen = false;
- } else if (i.component.customId == "right") {
+ } else if (i.component.customId === "right") {
if (page < pages.length - 1) page++;
selectPaneOpen = false;
- } else if (i.component.customId == "select") {
+ } else if (i.component.customId === "select") {
selectPaneOpen = !selectPaneOpen;
- } else if (i.component.customId == "page") {
+ } else if (i.component.customId === "page") {
page = parseInt(i.values[0]);
selectPaneOpen = false;
} else {
if (interaction) {
let em = new Discord.MessageEmbed(pages[page].embed)
- em.setDescription(em.description + "\n\n" + createPageIndicator(pages.length, page) + " | Message closed");
+ em.setDescription(em.description + "\n\n" + createPageIndicator(pages.length, page));
+ em.setFooter({text: "Message closed"})
interaction.editReply({embeds: [em], components: [new MessageActionRow().addComponents([
new MessageButton().setCustomId("left").setEmoji(getEmojiByName("CONTROL.LEFT", "id")).setStyle("SECONDARY").setDisabled(true),
new MessageButton().setCustomId("select").setEmoji(getEmojiByName("CONTROL.MENU", "id")).setStyle(selectPaneOpen ? "PRIMARY" : "SECONDARY").setDisabled(true),
- new MessageButton().setCustomId("right").setEmoji(getEmojiByName("CONTROL.RIGHT", "id")).setStyle("SECONDARY").setDisabled(true),
- new MessageButton().setCustomId("close").setEmoji(getEmojiByName("CONTROL.CROSS", "id")).setStyle("DANGER").setDisabled(true)
- ])], fetchReply: true});
+ new MessageButton().setCustomId("right").setEmoji(getEmojiByName("CONTROL.RIGHT", "id")).setStyle("SECONDARY").setDisabled(true)
+ ])]});
} else {
m.delete();
}
return;
}
}
- const { NucleusColors } = client.logger
if (interaction) {
let em = new Discord.MessageEmbed(pages[page].embed)
- em.setDescription(em.description + "\n\n" + createPageIndicator(pages.length, page) + " | Message timed out").setColor(NucleusColors.Danger);
+ em.setDescription(em.description + "\n\n" + createPageIndicator(pages.length, page)).setFooter({text: "Message timed out"});
await interaction.editReply({
embeds: [em],
components: [new MessageActionRow().addComponents([
new MessageButton().setCustomId("left").setEmoji(getEmojiByName("CONTROL.LEFT", "id")).setStyle("SECONDARY").setDisabled(true),
new MessageButton().setCustomId("select").setEmoji(getEmojiByName("CONTROL.MENU", "id")).setStyle("SECONDARY").setDisabled(true),
- new MessageButton().setCustomId("right").setEmoji(getEmojiByName("CONTROL.RIGHT", "id")).setStyle("SECONDARY").setDisabled(true),
- new MessageButton().setCustomId("close").setEmoji(getEmojiByName("CONTROL.CROSS", "id")).setStyle("DANGER").setDisabled(true)
+ new MessageButton().setCustomId("right").setEmoji(getEmojiByName("CONTROL.RIGHT", "id")).setStyle("SECONDARY").setDisabled(true)
])]
});
} else {
let em = new Discord.MessageEmbed(pages[page].embed)
- em.setDescription(em.description + "\n\n" + createPageIndicator(pages.length, page) + " | Message timed out").setColor(NucleusColors.Danger);
+ em.setDescription(em.description + "\n\n" + createPageIndicator(pages.length, page)).setFooter({text: "Message timed out"});
await m.edit({
embeds: [em],
components: [new MessageActionRow().addComponents([
new MessageButton().setCustomId("left").setEmoji(getEmojiByName("CONTROL.LEFT", "id")).setStyle("SECONDARY").setDisabled(true),
new MessageButton().setCustomId("select").setEmoji(getEmojiByName("CONTROL.MENU", "id")).setStyle("SECONDARY").setDisabled(true),
- new MessageButton().setCustomId("right").setEmoji(getEmojiByName("CONTROL.RIGHT", "id")).setStyle("SECONDARY").setDisabled(true),
- new MessageButton().setCustomId("close").setEmoji(getEmojiByName("CONTROL.CROSS", "id")).setStyle("DANGER").setDisabled(true)
+ new MessageButton().setCustomId("right").setEmoji(getEmojiByName("CONTROL.RIGHT", "id")).setStyle("SECONDARY").setDisabled(true)
])]
});
}
diff --git a/src/reflex/scanners.ts b/src/reflex/scanners.ts
index a1a5974..3b80816 100644
--- a/src/reflex/scanners.ts
+++ b/src/reflex/scanners.ts
@@ -84,7 +84,7 @@
}
export async function SizeCheck(element): Promise<boolean> {
- if (element.height == undefined || element.width == undefined) return true
+ if (element.height === undefined || element.width === undefined) return true
if (element.height < 20 || element.width < 20) return false
return true
}
@@ -105,7 +105,7 @@
}
for(let word of soft) {
for(let word2 of string.match(/[a-z]+/gi) || []) {
- if (word2 == word) {
+ if (word2 === word) {
return {word: word, type: "strict"}
}
}
diff --git a/src/reflex/statsChannelUpdate.ts b/src/reflex/statsChannelUpdate.ts
index 7d04c8f..b306ecc 100644
--- a/src/reflex/statsChannelUpdate.ts
+++ b/src/reflex/statsChannelUpdate.ts
@@ -17,15 +17,20 @@
fetchedChannel = await guild.channels.fetch(channel)
} catch (e) { fetchedChannel = null }
if (!fetchedChannel) {
+ let deleted = config.getKey("stats")[channel]
+ console.log(`stats.${channel}`)
+ console.log(guild.id)
+ await client.database.guilds.write(guild.id, null, `stats.${channel}`)
return singleNotify(
"statsChannelDeleted",
guild.id,
- "One or more of your stats channels have been deleted. Please open the settings menu to change this.",
+ "One or more of your stats channels have been deleted. Please use `/settings stats` if you wish to add the channel again.\n" +
+ `The channels name was: ${deleted.name}`,
"Critical"
)
}
try {
- await fetchedChannel.setName(string)
+ await fetchedChannel.setName(string.slice(0, 100))
} catch (e) {
console.error(e)
}
diff --git a/src/reflex/verify.ts b/src/reflex/verify.ts
index 9d90dde..b95cdb7 100644
--- a/src/reflex/verify.ts
+++ b/src/reflex/verify.ts
@@ -1,3 +1,4 @@
+import { LoadingEmbed } from './../utils/defaultEmbeds.js';
import Discord, { GuildMember } from "discord.js";
import EmojiEmbed from "../utils/generateEmojiEmbed.js";
import fetch from "node-fetch";
@@ -11,12 +12,7 @@
export default async function(interaction) {
let verify = client.verify
- await interaction.reply({embeds: [new EmojiEmbed()
- .setTitle("Loading")
- .setDescription(step(-1))
- .setStatus("Danger")
- .setEmoji("NUCLEUS.LOADING")
- ], ephemeral: true, fetchReply: true});
+ await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
let config = await client.database.guilds.read(interaction.guild.id);
if ((!config.verify.enabled ) || (!config.verify.role)) return interaction.editReply({embeds: [new EmojiEmbed()
.setTitle("Verify")
@@ -40,7 +36,7 @@
]});
try {
let status = await fetch(client.config.baseUrl).then(res => res.status);
- if (status != 200) {
+ if (status !== 200) {
return await interaction.editReply({embeds: [new EmojiEmbed()
.setTitle("Verify")
.setDescription(`Our servers appear to be down, please try again later` + step(0))