Squashed Bugs
diff --git a/src/commands/mod/about.ts b/src/commands/mod/about.ts
index 9630288..fc656ff 100644
--- a/src/commands/mod/about.ts
+++ b/src/commands/mod/about.ts
@@ -7,7 +7,6 @@
ActionRowBuilder,
ButtonBuilder,
MessageComponentInteraction,
- ModalSubmitInteraction,
ButtonStyle,
TextInputStyle,
APIMessageComponentEmoji,
@@ -427,13 +426,10 @@
}
if (out === null || out.isButton()) {
continue;
- } else if (out instanceof ModalSubmitInteraction) {
- let toAdd = out.fields.getTextInputValue("note") || null;
- if (toAdd === " ") toAdd = null;
- if (toAdd) toAdd = toAdd.trim();
- await client.database.notes.create(member.guild.id, member.id, toAdd);
} else {
- continue;
+ let toAdd = out.fields.getTextInputValue("note").trim() || null;
+ if (toAdd === "") toAdd = null;
+ await client.database.notes.create(member.guild.id, member.id, toAdd);
}
} else if (i.customId === "history") {
await i.deferUpdate();
diff --git a/src/commands/settings/automod.ts b/src/commands/settings/automod.ts
index 5b4198f..de8e740 100644
--- a/src/commands/settings/automod.ts
+++ b/src/commands/settings/automod.ts
@@ -757,8 +757,9 @@
.addComponents(
new ActionRowBuilder<TextInputBuilder>().addComponents(
new TextInputBuilder()
+ .setLabel("Amount")
.setCustomId("mass")
- .setPlaceholder("Amount")
+ .setPlaceholder(current.mass === 5 ? "Amount" : current.mass.toString())
.setMinLength(1)
.setMaxLength(3)
.setStyle(TextInputStyle.Short)
diff --git a/src/utils/database.ts b/src/utils/database.ts
index b42b8b2..dd768a3 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -698,7 +698,10 @@
async create(guild: string, user: string, note: string | null) {
// console.log("ModNotes create");
- await this.modNotes.updateOne({ guild: guild, user: user }, { $set: { note: note } }, { upsert: true });
+ const modNote = await this.modNotes.findOne({ guild: guild, user: user });
+ modNote
+ ? await this.modNotes.updateOne({ guild: guild, user: user }, { $set: { note: note } }, collectionOptions)
+ : await this.modNotes.insertOne({ guild: guild, user: user, note: note }, collectionOptions);
}
async read(guild: string, user: string) {