mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(GuildPreview): Add stickers (#7152)
This commit is contained in:
@@ -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<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
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -1146,6 +1146,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;
|
||||
|
||||
Reference in New Issue
Block a user