diff --git a/src/structures/message.ts b/src/structures/message.ts index 02bdaa7d9..47a798594 100644 --- a/src/structures/message.ts +++ b/src/structures/message.ts @@ -161,6 +161,8 @@ export async function createDiscordenoMessage(data: Message) { } props.authorId = createNewProp(snowflakeToBigint(author.id)); + props.isBot = createNewProp(author.bot || false); + props.tag = createNewProp(`${author.username}#${author.discriminator}`); // Discord doesnt give guild id for getMessage() so this will fill it in const guildIdFinal = guildId || @@ -221,8 +223,14 @@ export interface DiscordenoMessage extends | "guildId" | "channelId" | "member" + | "author" > { id: bigint; + author: undefined; + /** Whether or not this message was sent by a bot */ + isBot: boolean; + /** The username#discrimnator for the user who sent this message */ + tag: string; // For better user experience /** Id of the guild which the massage has been send in. "0n" if it a DM */ guildId: bigint; diff --git a/src/types/webhooks/execute_webhook.ts b/src/types/webhooks/execute_webhook.ts index 4e3a956a0..f668a0906 100644 --- a/src/types/webhooks/execute_webhook.ts +++ b/src/types/webhooks/execute_webhook.ts @@ -16,11 +16,11 @@ export interface ExecuteWebhook { /** True if this is a TTS message */ tts?: boolean; /** The contents of the file being sent */ - file: FileContent | FileContent[]; + file?: FileContent | FileContent[]; /** Embedded `rich` content */ - embeds: Embed[]; + embeds?: Embed[]; /** Allowed mentions for the message */ - allowedMentions: AllowedMentions; + allowedMentions?: AllowedMentions; } export type DiscordExecuteWebhook = SnakeCasedPropertiesDeep< diff --git a/tests/messages/delete_messages.ts b/tests/messages/delete_messages.ts index 6d7a2d7e5..af0041931 100644 --- a/tests/messages/delete_messages.ts +++ b/tests/messages/delete_messages.ts @@ -1,7 +1,7 @@ import { cache, deleteMessages, sendMessage } from "../../mod.ts"; -import { defaultTestOptions, tempData } from "../ws/start_bot.ts"; import { assertExists } from "../deps.ts"; import { delayUntil } from "../util/delay_until.ts"; +import { defaultTestOptions, tempData } from "../ws/start_bot.ts"; async function ifItFailsBlameWolf(reason?: string) { const message = await sendMessage(tempData.channelId, "Hello World!"); @@ -29,7 +29,7 @@ async function ifItFailsBlameWolf(reason?: string) { // Delete the message now await deleteMessages( tempData.channelId, - [message.id.toString(), secondMessage.id.toString()], + [message.id, secondMessage.id], reason, );