From cf25de9373df98b3c1cd0ca0a092d9dc8172929d Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Wed, 19 Jan 2022 19:36:05 +0000 Subject: [PATCH] feat(GuildPreview): Add stickers (#7152) --- packages/discord.js/src/structures/GuildPreview.js | 10 ++++++++++ packages/discord.js/typings/index.d.ts | 1 + 2 files changed, 11 insertions(+) diff --git a/packages/discord.js/src/structures/GuildPreview.js b/packages/discord.js/src/structures/GuildPreview.js index ea2505cac..fc2a1bf6a 100644 --- a/packages/discord.js/src/structures/GuildPreview.js +++ b/packages/discord.js/src/structures/GuildPreview.js @@ -4,6 +4,7 @@ const { Collection } = require('@discordjs/collection'); const { DiscordSnowflake } = require('@sapphire/snowflake'); const Base = require('./Base'); const GuildPreviewEmoji = require('./GuildPreviewEmoji'); +const { Sticker } = require('./Sticker'); /** * Represents the data about the guild any bot can preview, connected to the specified guild. @@ -103,6 +104,15 @@ class GuildPreview extends Base { for (const emoji of data.emojis) { this.emojis.set(emoji.id, new GuildPreviewEmoji(this.client, emoji, this)); } + + /** + * Collection of stickers belonging to this guild + * @type {Collection} + */ + this.stickers = data.stickers.reduce( + (stickers, sticker) => stickers.set(sticker.id, new Sticker(this.client, sticker)), + new Collection(), + ); } /** * The timestamp this guild was created at diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index c43368010..196a7ea36 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -1146,6 +1146,7 @@ export class GuildPreview extends Base { public description: string | null; public discoverySplash: string | null; public emojis: Collection; + public stickers: Collection; public features: GuildFeatures[]; public icon: string | null; public id: Snowflake;