feat(Message): Message.stickers

This commit is contained in:
socram03 2022-07-13 13:55:25 -04:00
parent c5e87790cc
commit 0dfaa16fa4

View File

@ -21,6 +21,7 @@ import Attachment from "./Attachment.ts";
import ComponentFactory from "./components/ComponentFactory.ts"; import ComponentFactory from "./components/ComponentFactory.ts";
import MessageReaction from "./MessageReaction.ts"; import MessageReaction from "./MessageReaction.ts";
import * as Routes from "../Routes.ts"; import * as Routes from "../Routes.ts";
import { StickerItem } from "./Sticker.ts";
/** /**
* @link https://discord.com/developers/docs/resources/channel#allowed-mentions-object * @link https://discord.com/developers/docs/resources/channel#allowed-mentions-object
@ -129,6 +130,16 @@ export class Message implements Model {
type: data.activity.type, type: data.activity.type,
}; };
} }
if (data.sticker_items) {
this.stickers = data.sticker_items.map((si) => {
return {
id: si.id,
name: si.name,
formatType: si.format_type
}
})
}
} }
readonly session: Session; readonly session: Session;
@ -149,6 +160,7 @@ export class Message implements Model {
timestamp: number; timestamp: number;
editedTimestamp?: number; editedTimestamp?: number;
stickers?: StickerItem[];
reactions: MessageReaction[]; reactions: MessageReaction[];
attachments: Attachment[]; attachments: Attachment[];
embeds: DiscordEmbed[]; embeds: DiscordEmbed[];