Add different transcript types
diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index 2c8129e..c5fe2fb 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -170,6 +170,7 @@
};
log(data);
const newOut = await client.database.transcripts.createTranscript(
+ "purge",
deleted,
interaction,
interaction.member as GuildMember
@@ -336,6 +337,7 @@
)
.map((message) => message as Message);
const newOut = await client.database.transcripts.createTranscript(
+ "purge",
messageArray,
interaction,
interaction.member as GuildMember
diff --git a/src/context/messages/purgeto.ts b/src/context/messages/purgeto.ts
index d2191d1..4f0ea1e 100644
--- a/src/context/messages/purgeto.ts
+++ b/src/context/messages/purgeto.ts
@@ -225,6 +225,7 @@
)
.map((message) => message as Message);
const transcript = await client.database.transcripts.createTranscript(
+ "purge",
messageArray,
interaction,
interaction.member as GuildMember
diff --git a/src/premium/createTranscript.ts b/src/premium/createTranscript.ts
index e7a0171..7a1f57f 100644
--- a/src/premium/createTranscript.ts
+++ b/src/premium/createTranscript.ts
@@ -57,7 +57,7 @@
if (mem) member = mem;
}
- const newOut = await client.database.transcripts.createTranscript(messages, interaction, member);
+ const newOut = await client.database.transcripts.createTranscript("ticket", messages, interaction, member);
const [code, key, iv] = await client.database.transcripts.create(newOut);
if (!code)
diff --git a/src/utils/database.ts b/src/utils/database.ts
index 89c108b..a5d5149 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -367,13 +367,14 @@
}
async createTranscript(
+ type: "ticket" | "purge",
messages: Message[],
interaction: MessageComponentInteraction | CommandInteraction,
member: GuildMember
) {
const interactionMember = await interaction.guild?.members.fetch(interaction.user.id);
const newOut: Omit<TranscriptSchema, "code"> = {
- type: "ticket",
+ type: type,
for: {
username: member!.user.username,
discriminator: parseInt(member!.user.discriminator),