discord.js/src/stores/GuildChannelStore.js
SpaceEEC 0101392334 Documentation improvements (#2069)
* 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
2017-10-28 19:04:03 +02:00

49 lines
1.3 KiB
JavaScript

const DataStore = require('./DataStore');
const Channel = require('../structures/Channel');
const GuildChannel = require('../structures/GuildChannel');
/**
* Stores guild channels.
* @private
* @extends {DataStore}
*/
class GuildChannelStore extends DataStore {
constructor(guild, iterable) {
super(guild.client, iterable, GuildChannel);
this.guild = guild;
}
create(data) {
const existing = this.get(data.id);
if (existing) return existing;
return Channel.create(this.client, data, this.guild);
}
/**
* Data that can be resolved to give a Guild Channel object. This can be:
* * A GuildChannel object
* * A Snowflake
* @typedef {GuildChannel|Snowflake} GuildChannelResolvable
*/
/**
* Resolves a GuildChannelResolvable to a Channel object.
* @method resolve
* @memberof GuildChannelStore
* @instance
* @param {GuildChannelResolvable} channel The GuildChannel resolvable to resolve
* @returns {?Channel}
*/
/**
* Resolves a GuildChannelResolvable to a channel ID string.
* @method resolveID
* @memberof GuildChannelStore
* @instance
* @param {GuildChannelResolvable} channel The GuildChannel resolvable to resolve
* @returns {?Snowflake}
*/
}
module.exports = GuildChannelStore;