From 3686f24ca03da24f8696430ab8fc7048a193288f Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Sat, 5 Apr 2025 23:32:41 -0500 Subject: [PATCH] don't allow blank messages and trim fake messages --- src/webpage/channel.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/webpage/channel.ts b/src/webpage/channel.ts index cd810e0..3353332 100644 --- a/src/webpage/channel.ts +++ b/src/webpage/channel.ts @@ -1465,7 +1465,7 @@ class Channel extends SnowFlake { channel_id: this.id, guild_id: this.guild.id, id: "fake" + Math.random(), - content, + content: content.trim(), timestamp: new Date() + "", edited_timestamp: null, mentions: [], @@ -1541,8 +1541,12 @@ class Channel extends SnowFlake { { attachments = [], replyingto = null, + embeds = [], }: {attachments: Blob[]; embeds: embedjson[]; replyingto: Message | null}, ) { + if (content.trim() === "" && attachments.length === 0 && embeds.length == 0) { + return; + } let replyjson: any; if (replyingto) { replyjson = {