mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
Add snowflake utils (#1064)
* snowflakes * use proper binary for snowflake example * fix jsdoc errors * remove dupe
This commit is contained in:
@@ -25,25 +25,25 @@ class Guild {
|
||||
|
||||
/**
|
||||
* A collection of members that are in this guild. The key is the member's ID, the value is the member.
|
||||
* @type {Collection<string, GuildMember>}
|
||||
* @type {Collection<Snowflake, GuildMember>}
|
||||
*/
|
||||
this.members = new Collection();
|
||||
|
||||
/**
|
||||
* A collection of channels that are in this guild. The key is the channel's ID, the value is the channel.
|
||||
* @type {Collection<string, GuildChannel>}
|
||||
* @type {Collection<Snowflake, GuildChannel>}
|
||||
*/
|
||||
this.channels = new Collection();
|
||||
|
||||
/**
|
||||
* A collection of roles that are in this guild. The key is the role's ID, the value is the role.
|
||||
* @type {Collection<string, Role>}
|
||||
* @type {Collection<Snowflake, Role>}
|
||||
*/
|
||||
this.roles = new Collection();
|
||||
|
||||
/**
|
||||
* A collection of presences in this guild
|
||||
* @type {Collection<string, Presence>}
|
||||
* @type {Collection<Snowflake, Presence>}
|
||||
*/
|
||||
this.presences = new Collection();
|
||||
|
||||
@@ -57,7 +57,7 @@ class Guild {
|
||||
|
||||
/**
|
||||
* The Unique ID of the Guild, useful for comparisons.
|
||||
* @type {string}
|
||||
* @type {Snowflake}
|
||||
*/
|
||||
this.id = data.id;
|
||||
} else {
|
||||
@@ -116,13 +116,13 @@ class Guild {
|
||||
|
||||
/**
|
||||
* The ID of the application that created this guild (if applicable)
|
||||
* @type {?string}
|
||||
* @type {?Snowflake}
|
||||
*/
|
||||
this.applicationID = data.application_id;
|
||||
|
||||
/**
|
||||
* A collection of emojis that are in this guild. The key is the emoji's ID, the value is the emoji.
|
||||
* @type {Collection<string, Emoji>}
|
||||
* @type {Collection<Snowflake, Emoji>}
|
||||
*/
|
||||
this.emojis = new Collection();
|
||||
for (const emoji of data.emojis) this.emojis.set(emoji.id, new Emoji(this, emoji));
|
||||
@@ -169,7 +169,7 @@ class Guild {
|
||||
if (data.owner_id) {
|
||||
/**
|
||||
* The user ID of this guild's owner.
|
||||
* @type {string}
|
||||
* @type {Snowflake}
|
||||
*/
|
||||
this.ownerID = data.owner_id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user