mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 18:00:08 +00:00
fix editMessage interface and function (#2054)
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
@@ -16,7 +16,7 @@ export async function editMessage(bot: Bot, channelId: bigint, messageId: bigint
|
||||
type: embed.type,
|
||||
description: embed.description,
|
||||
url: embed.url,
|
||||
timestamp: embed.timestamp,
|
||||
timestamp: embed.timestamp ? new Date(embed.timestamp).toISOString() : undefined,
|
||||
color: embed.color,
|
||||
footer: embed.footer
|
||||
? {
|
||||
|
||||
@@ -42,12 +42,7 @@ export function transformEmbed(bot: Bot, payload: SnakeCasedPropertiesDeep<Embed
|
||||
width: payload.video.width,
|
||||
}
|
||||
: undefined,
|
||||
provider: payload.provider
|
||||
? {
|
||||
name: payload.provider.name,
|
||||
url: payload.provider.url,
|
||||
}
|
||||
: undefined,
|
||||
provider: payload.provider,
|
||||
author: payload.author
|
||||
? {
|
||||
name: payload.author.name,
|
||||
@@ -56,11 +51,7 @@ export function transformEmbed(bot: Bot, payload: SnakeCasedPropertiesDeep<Embed
|
||||
proxyIconUrl: payload.author.proxy_icon_url,
|
||||
}
|
||||
: undefined,
|
||||
fields: payload.fields?.map((field) => ({
|
||||
name: field.name,
|
||||
value: field.value,
|
||||
inline: field.inline,
|
||||
})),
|
||||
fields: payload.fields,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FileContent } from "../discordeno/fileContent.ts";
|
||||
import { Embed } from "../embeds/embed.ts";
|
||||
import { DiscordenoEmbed } from "../../transformers/embed.ts";
|
||||
import { AllowedMentions } from "./allowedMentions.ts";
|
||||
import { Attachment } from "./attachment.ts";
|
||||
import { MessageComponents } from "./components/messageComponents.ts";
|
||||
@@ -9,7 +9,7 @@ export interface EditMessage {
|
||||
/** The new message contents (up to 2000 characters) */
|
||||
content?: string | null;
|
||||
/** Embedded `rich` content (up to 6000 characters) */
|
||||
embeds?: Embed[] | null;
|
||||
embeds?: DiscordenoEmbed[] | null;
|
||||
/** Edit the flags of the message (only `SUPRESS_EMBEDS` can currently be set/unset) */
|
||||
flags?: 4 | null;
|
||||
/** The contents of the file being sent/edited */
|
||||
|
||||
Reference in New Issue
Block a user