diff --git a/src/managers/GuildBanManager.js b/src/managers/GuildBanManager.js index a59772113..c8d60415e 100644 --- a/src/managers/GuildBanManager.js +++ b/src/managers/GuildBanManager.js @@ -120,12 +120,17 @@ class GuildBanManager extends BaseManager { return data.reduce((col, ban) => col.set(ban.user.id, this.add(ban, cache)), new Collection()); } + /** + * Options for banning a user. + * @typedef {Object} BanOptions + * @property {number} [days] Number of days of messages to delete, must be between 0 and 7, inclusive + * @property {string} [reason] Reason for banning + */ + /** * Bans a user from the guild. * @param {UserResolvable} user The user to ban - * @param {Object} [options] Options for the ban - * @param {number} [options.days=0] Number of days of messages to delete, must be between 0 and 7, inclusive - * @param {string} [options.reason] Reason for banning + * @param {BanOptions} [options] Options for the ban * @returns {Promise} Result object will be resolved as specifically as possible. * If the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot * be resolved, the user ID will be the result. diff --git a/src/managers/GuildMemberManager.js b/src/managers/GuildMemberManager.js index 1006fd988..0266b35f3 100644 --- a/src/managers/GuildMemberManager.js +++ b/src/managers/GuildMemberManager.js @@ -138,12 +138,17 @@ class GuildMemberManager extends BaseManager { return this._fetchMany(options); } + /** + * Options for searching for guild members. + * @typedef {Object} GuildSearchMembersOptions + * @property {string} query Filter members whose username or nickname start with this query + * @property {number} [limit] Maximum number of members to search + * @property {boolean} [cache] Whether or not to cache the fetched member(s) + */ + /** * Search for members in the guild based on a query. - * @param {Object} options Search options - * @property {string} options.query Filter members whose username or nickname start with this query - * @property {number} [options.limit=1] Maximum number of members to search - * @property {boolean} [options.cache=true] Whether or not to cache the fetched member(s) + * @param {GuildSearchMembersOptions} options Search options * @returns {Promise>} */ async search({ query, limit = 1, cache = true } = {}) { @@ -192,15 +197,20 @@ class GuildMemberManager extends BaseManager { return clone ?? this.add(d, false); } + /** + * Options for pruning guild members. + * @typedef {Object} GuildPruneMembersOptions + * @property {number} [days] Number of days of inactivity required to kick + * @property {boolean} [dry] Get number of users that will be kicked, without actually kicking them + * @property {boolean} [count] Whether or not to return the number of users that have been kicked. + * @property {RoleResolvable[]} [roles] Array of roles to bypass the "...and no roles" constraint when pruning + * @property {string} [reason] Reason for this prune + */ + /** * Prunes members from the guild based on how long they have been inactive. * It's recommended to set options.count to `false` for large guilds. - * @param {Object} [options] Prune options - * @param {number} [options.days=7] Number of days of inactivity required to kick - * @param {boolean} [options.dry=false] Get number of users that will be kicked, without actually kicking them - * @param {boolean} [options.count=true] Whether or not to return the number of users that have been kicked. - * @param {RoleResolvable[]} [options.roles=[]] Array of roles to bypass the "...and no roles" constraint when pruning - * @param {string} [options.reason] Reason for this prune + * @param {GuildPruneMembersOptions} [options] Prune options * @returns {Promise} The number of members that were/will be kicked * @example * // See how many members will be pruned @@ -276,9 +286,7 @@ class GuildMemberManager extends BaseManager { /** * Bans a user from the guild. * @param {UserResolvable} user The user to ban - * @param {Object} [options] Options for the ban - * @param {number} [options.days=0] Number of days of messages to delete, must be between 0 and 7, inclusive - * @param {string} [options.reason] Reason for banning + * @param {BanOptions} [options] Options for the ban * @returns {Promise} Result object will be resolved as specifically as possible. * If the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot * be resolved, the user ID will be the result.