fix editMessage interface and function (#2054)

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
LTS20050703
2022-02-25 22:23:32 +07:00
committed by GitHub
parent 4e06ed6b2c
commit 79dbf690dc
3 changed files with 5 additions and 14 deletions

View File

@@ -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
? {

View File

@@ -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,
};
}

View File

@@ -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 */