Merge branch 'development' of github.com:ClicksMinutePer/Nucleus into development
diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index 7728e56..a1b094e 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -319,6 +319,7 @@
const newOut = await client.database.transcripts.createTranscript(messageArray, interaction, interaction.member as GuildMember);
const [code, key, iv] = await client.database.transcripts.create(newOut);
+
await interaction.editReply({
embeds: [
new EmojiEmbed()
@@ -330,6 +331,7 @@
components: [
new Discord.ActionRowBuilder<ButtonBuilder>().addComponents([
new ButtonBuilder().setLabel("View").setStyle(ButtonStyle.Link).setURL(`https://clicks.codes/nucleus/transcript/${code}?key=${key}&iv=${iv}`).setDisabled(!code),
+
])
]
});
diff --git a/src/context/messages/purgeto.ts b/src/context/messages/purgeto.ts
index 0dc84e1..3d7e95a 100644
--- a/src/context/messages/purgeto.ts
+++ b/src/context/messages/purgeto.ts
@@ -193,7 +193,9 @@
)
)).map(message => message as Message);
const transcript = await client.database.transcripts.createTranscript(messageArray, interaction, interaction.member as GuildMember);
+
const [code, key, iv] = await client.database.transcripts.create(transcript);
+
await interaction.editReply({
embeds: [
new EmojiEmbed()
diff --git a/src/utils/database.ts b/src/utils/database.ts
index 45c7661..278aa34 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -16,6 +16,7 @@
const collectionOptions = { authdb: config.mongoOptions.authSource, w: "majority" };
const getIV = () => crypto.randomBytes(16);
+
export class Guilds {
guilds: Collection<GuildConfig>;
defaultData: GuildConfig;
@@ -533,7 +534,6 @@
const entry = await this.premium.findOne({ user: user });
return entry ? true : false;
}
-
async createUser(user: string, level: number) {
// console.log("Premium createUser");
await this.premium.insertOne({ user: user, appliesTo: [], level: level }, collectionOptions);
diff --git a/src/utils/log.ts b/src/utils/log.ts
index 11cabe8..bb95eda 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -82,6 +82,7 @@
console.log(log.hidden.guild)
const config = await client.database.guilds.read(log.hidden.guild);
console.log(config.logging.logs.channel)
+
if (config.logging.logs.channel) {
const channel = (await client.channels.fetch(config.logging.logs.channel)) as Discord.TextChannel | null;
const description: Record<string, string> = {};