don't allow blank messages and trim fake messages
This commit is contained in:
parent
1a022f06ee
commit
3686f24ca0
1 changed files with 5 additions and 1 deletions
|
@ -1465,7 +1465,7 @@ class Channel extends SnowFlake {
|
||||||
channel_id: this.id,
|
channel_id: this.id,
|
||||||
guild_id: this.guild.id,
|
guild_id: this.guild.id,
|
||||||
id: "fake" + Math.random(),
|
id: "fake" + Math.random(),
|
||||||
content,
|
content: content.trim(),
|
||||||
timestamp: new Date() + "",
|
timestamp: new Date() + "",
|
||||||
edited_timestamp: null,
|
edited_timestamp: null,
|
||||||
mentions: [],
|
mentions: [],
|
||||||
|
@ -1541,8 +1541,12 @@ class Channel extends SnowFlake {
|
||||||
{
|
{
|
||||||
attachments = [],
|
attachments = [],
|
||||||
replyingto = null,
|
replyingto = null,
|
||||||
|
embeds = [],
|
||||||
}: {attachments: Blob[]; embeds: embedjson[]; replyingto: Message | null},
|
}: {attachments: Blob[]; embeds: embedjson[]; replyingto: Message | null},
|
||||||
) {
|
) {
|
||||||
|
if (content.trim() === "" && attachments.length === 0 && embeds.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let replyjson: any;
|
let replyjson: any;
|
||||||
if (replyingto) {
|
if (replyingto) {
|
||||||
replyjson = {
|
replyjson = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue