fix(structures): parse Message.stickers / edit known issues

This commit is contained in:
Yuzu 2022-07-13 12:53:02 -05:00
parent c5e87790cc
commit 6a0fd891ef
4 changed files with 10 additions and 2 deletions

View File

@ -78,7 +78,7 @@ session.start();
- We got the library running on WSL (Ubuntu) without any trouble
### Known issues:
* some properties may be not implemented yet (eg: Message.stickers)
* some properties may be not implemented yet
* some structures are not implemented (see https://github.com/oasisjs/biscuit/issues)
* cache (wip)
* no optimal way to create embeds, should be fixed in builders tho

View File

@ -20,6 +20,7 @@ export * from "./structures/Permissions.ts";
export * from "./structures/Presence.ts";
export * from "./structures/Role.ts";
export * from "./structures/StageInstance.ts";
export * from "./structures/Sticker.ts";
export * from "./structures/ThreadMember.ts";
export * from "./structures/User.ts";
export * from "./structures/Webhook.ts";

View File

@ -20,6 +20,7 @@ import Member from "./Member.ts";
import Attachment from "./Attachment.ts";
import ComponentFactory from "./components/ComponentFactory.ts";
import MessageReaction from "./MessageReaction.ts";
import Sticker from "./Sticker.ts";
import * as Routes from "../Routes.ts";
/**
@ -101,6 +102,7 @@ export class Message implements Model {
this.reactions = data.reactions?.map((react) => new MessageReaction(session, react)) ?? [];
this.attachments = data.attachments.map((attachment) => new Attachment(session, attachment));
this.embeds = data.embeds;
this.stickers = data.stickers?.map((sticker) => new Sticker(session, sticker)) ?? [];
if (data.thread && data.guild_id) {
this.thread = new ThreadChannel(session, data.thread, data.guild_id);
@ -156,6 +158,9 @@ export class Message implements Model {
thread?: ThreadChannel;
components: Component[];
/** @deprecated */
stickers: Sticker[];
webhook?: WebhookAuthor;
activity?: {
partyId?: Snowflake;

View File

@ -1,5 +1,5 @@
import type { DiscordSticker, DiscordStickerPack, StickerFormatTypes, StickerTypes } from "../../discordeno/mod.ts";
import { Model } from "./Base.ts";
import type { Model } from "./Base.ts";
import type { Snowflake } from "../Snowflake.ts";
import type { Session } from "../Session.ts";
import { User } from "./User.ts";
@ -66,3 +66,5 @@ export class Sticker implements Model {
};
}
}
export default Sticker;