diff --git a/README.md b/README.md index 2cb53fa..6059bdd 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/packages/biscuit/mod.ts b/packages/biscuit/mod.ts index 0fba7e2..801fcd3 100644 --- a/packages/biscuit/mod.ts +++ b/packages/biscuit/mod.ts @@ -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"; diff --git a/packages/biscuit/structures/Message.ts b/packages/biscuit/structures/Message.ts index 795fd39..fac1552 100644 --- a/packages/biscuit/structures/Message.ts +++ b/packages/biscuit/structures/Message.ts @@ -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; diff --git a/packages/biscuit/structures/Sticker.ts b/packages/biscuit/structures/Sticker.ts index 9321255..5e92128 100644 --- a/packages/biscuit/structures/Sticker.ts +++ b/packages/biscuit/structures/Sticker.ts @@ -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;