made premium check faster. Added transcript endpoint, toHumanReadable function.
diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index 8d49c3b..5e0a795 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -1,4 +1,3 @@
-import { JSONTranscriptFromMessageArray, JSONTranscriptToHumanReadable } from '../../utils/logTranscripts.js';
import Discord, { CommandInteraction, GuildChannel, GuildMember, TextChannel, ButtonStyle, ButtonBuilder } from "discord.js";
import type { SlashCommandSubcommandBuilder } from "discord.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
@@ -161,7 +160,8 @@
}
};
log(data);
- const transcript = JSONTranscriptToHumanReadable(JSONTranscriptFromMessageArray(deleted)!);
+ const newOut = await client.database.transcripts.createTranscript(deleted, interaction, interaction.member as GuildMember);
+ const transcript = client.database.transcripts.toHumanReadable(newOut);
const attachmentObject = {
attachment: Buffer.from(transcript),
name: `purge-${channel.id}-${Date.now()}.txt`,
diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index b31accb..325c360 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -67,7 +67,7 @@
}
const callback = async (interaction: CommandInteraction): Promise<void> => {
-
+ if (interaction.guild) client.database.premium.hasPremium(interaction.guild.id).finally(() => {});
await interaction.reply({embeds: LoadingEmbed, ephemeral: true})
const member = await (await interaction.client.guilds.fetch("684492926528651336")).members.fetch(interaction.user.id).catch(() => {
interaction.editReply({ embeds: [
@@ -172,7 +172,7 @@
components: []
});
} else {
- client.database.premium.addPremium(interaction.user.id, guild.id);
+ await client.database.premium.addPremium(interaction.user.id, guild.id);
interaction.editReply({
embeds: [
new EmojiEmbed()
diff --git a/src/commands/server/buttons.ts b/src/commands/server/buttons.ts
index e4bda0d..3297616 100644
--- a/src/commands/server/buttons.ts
+++ b/src/commands/server/buttons.ts
@@ -32,7 +32,7 @@
const buttonNames: Record<string, string> = {
verifybutton: "Verify",
rolemenu: "Role Menu",
- createticket: "Ticket"
+ createticket: "Create Ticket"
}
export const callback = async (interaction: CommandInteraction): Promise<void> => {
@@ -195,8 +195,8 @@
continue;
}
if (!out || out.isButton()) continue
- data.title = out.fields.getTextInputValue("title");
- data.description = out.fields.getTextInputValue("description");
+ data.title = out.fields.getTextInputValue("title").length === 0 ? null : out.fields.getTextInputValue("title");
+ data.description = out.fields.getTextInputValue("description").length === 0 ? null : out.fields.getTextInputValue("description");
break;
}
case "send": {
diff --git a/src/commands/settings/logs/attachment.ts b/src/commands/settings/logs/attachment.ts
index c04c7cf..238b8b9 100644
--- a/src/commands/settings/logs/attachment.ts
+++ b/src/commands/settings/logs/attachment.ts
@@ -12,6 +12,7 @@
.setDescription("Where attachments should be logged to (Premium only)")
const callback = async (interaction: CommandInteraction): Promise<unknown> => {
+ if (interaction.guild) client.database.premium.hasPremium(interaction.guild.id).finally(() => {});
await interaction.reply({
embeds: LoadingEmbed,
ephemeral: true,