Logging of empty messages
This commit is contained in:
parent
c3fa8d3b1f
commit
d007acc64e
@ -93,7 +93,7 @@ router.patch(
|
|||||||
}
|
}
|
||||||
} else rights.hasThrow("SELF_EDIT_MESSAGES");
|
} else rights.hasThrow("SELF_EDIT_MESSAGES");
|
||||||
|
|
||||||
// //@ts-expect-error Something is wrong with message_reference here, TS complains since "channel_id" is optional in MessageCreateSchema
|
//@ts-expect-error Something is wrong with message_reference here, TS complains since "channel_id" is optional in MessageCreateSchema
|
||||||
const new_message = await handleMessage({
|
const new_message = await handleMessage({
|
||||||
...message,
|
...message,
|
||||||
// TODO: should message_reference be overridable?
|
// TODO: should message_reference be overridable?
|
||||||
|
|||||||
@ -207,6 +207,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
|
|||||||
!opts.poll &&
|
!opts.poll &&
|
||||||
!opts.components?.length
|
!opts.components?.length
|
||||||
) {
|
) {
|
||||||
|
console.log("[Message] Rejecting empty message:", opts, message);
|
||||||
throw new HTTPError("Empty messages are not allowed", 50006);
|
throw new HTTPError("Empty messages are not allowed", 50006);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,7 +495,7 @@ interface MessageOptions extends MessageCreateSchema {
|
|||||||
embeds?: Embed[];
|
embeds?: Embed[];
|
||||||
reactions?: Reaction[];
|
reactions?: Reaction[];
|
||||||
channel_id?: string;
|
channel_id?: string;
|
||||||
// attachments?: Attachment[]; // why are we masking this?
|
attachments?: Attachment[]; // why are we masking this?
|
||||||
edited_timestamp?: Date;
|
edited_timestamp?: Date;
|
||||||
timestamp?: Date;
|
timestamp?: Date;
|
||||||
username?: string;
|
username?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user