mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
* docs: fix documentation in various places All stores: resolveID returns a nullable Snowflake GuildAuditLogs: ActionType also can be ALL MessageEmbed: make files property show up in the docs ClientApplication: resetSecret and resetToken return a promise ClientManager: status is readonly Guild: features is an array of strings and ban no longer accepts a number or string Guild: ban method no longer accepts a string or number GuildMember: ^ RichPresenceAssets: small and large Image are Snowflakes, also fixed parameter documentation for small and large image url method WebhookMessageOptions: file property is no longer a thing * docs: improve GuildAuditLogs documentation Prefix types with AuditLog to avoid confusion Document GuildAuditLogs' static Targets and Actions properties and add necessary typedefs Use typdefs over primitives where possible. * fix documentation for Guild#defaultRole
46 lines
1008 B
JavaScript
46 lines
1008 B
JavaScript
const DataStore = require('./DataStore');
|
|
const Role = require('../structures/Role');
|
|
|
|
/**
|
|
* Stores roles.
|
|
* @private
|
|
* @extends {DataStore}
|
|
*/
|
|
class RoleStore extends DataStore {
|
|
constructor(guild, iterable) {
|
|
super(guild.client, iterable, Role);
|
|
this.guild = guild;
|
|
}
|
|
|
|
create(data, cache) {
|
|
return super.create(data, cache, { extras: [this.guild] });
|
|
}
|
|
|
|
/**
|
|
* Data that can be resolved to a Role object. This can be:
|
|
* * A Role
|
|
* * A Snowflake
|
|
* @typedef {Role|Snowflake} RoleResolvable
|
|
*/
|
|
|
|
/**
|
|
* Resolves a RoleResolvable to a Role object.
|
|
* @method resolve
|
|
* @memberof RoleStore
|
|
* @instance
|
|
* @param {RoleResolvable} role The role resolvable to resolve
|
|
* @returns {?Role}
|
|
*/
|
|
|
|
/**
|
|
* Resolves a RoleResolvable to a role ID string.
|
|
* @method resolveID
|
|
* @memberof RoleStore
|
|
* @instance
|
|
* @param {RoleResolvable} role The role resolvable to resolve
|
|
* @returns {?Snowflake}
|
|
*/
|
|
}
|
|
|
|
module.exports = RoleStore;
|