diff --git a/src/structures/Guild.js b/src/structures/Guild.js index c2f13c9..408276b 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -1684,6 +1684,26 @@ class Guild extends AnonymousGuild { }; } + /** + * Get the top emojis of this guild. + * @returns {Promise>} + */ + topEmojis() { + return new Promise((resolve, reject) => { + this.client.api + .guilds(this.id) + ['top-emojis'].get() + .then(data => { + const emojis = new Collection(); + for (const emoji of data.items) { + emojis.set(emoji.emoji_rank, this.emojis.cache.get(emoji.emoji_id)); + } + resolve(emojis); + }) + .catch(reject); + }); + } + /** * Creates a collection of this guild's roles, sorted by their position and ids. * @returns {Collection} diff --git a/typings/index.d.ts b/typings/index.d.ts index 2918811..332697e 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1340,6 +1340,7 @@ export class Guild extends AnonymousGuild { private _sortedChannels(channel: NonThreadGuildBasedChannel): Collection; public readonly afkChannel: VoiceChannel | null; + public topEmojis(): Promise>; public afkChannelId: Snowflake | null; public afkTimeout: number; public applicationId: Snowflake | null;