feat(GuildPreview): Add stickers to version 13 (#7554)

This commit is contained in:
Jiralite
2022-03-02 09:31:41 +00:00
committed by GitHub
parent 69ba067a65
commit 215dfe02d5
2 changed files with 11 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
const { Collection } = require('@discordjs/collection');
const Base = require('./Base');
const GuildPreviewEmoji = require('./GuildPreviewEmoji');
const { Sticker } = require('./Sticker');
const SnowflakeUtil = require('../util/SnowflakeUtil');
/**
@@ -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<Snowflake, Sticker>}
*/
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

1
typings/index.d.ts vendored
View File

@@ -1148,6 +1148,7 @@ export class GuildPreview extends Base {
public description: string | null;
public discoverySplash: string | null;
public emojis: Collection<Snowflake, GuildPreviewEmoji>;
public stickers: Collection<Snowflake, Sticker>;
public features: GuildFeatures[];
public icon: string | null;
public id: Snowflake;