mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
refactor(*): make typedefs for all options params (#5785)
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com> Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
@@ -727,13 +727,18 @@ class Guild extends BaseGuild {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Options used to fetch audit logs.
|
||||
* @typedef {Object} GuildAuditLogsFetchOptions
|
||||
* @property {Snowflake|GuildAuditLogsEntry} [before] Only return entries before this entry
|
||||
* @property {number} [limit] The number of entries to return
|
||||
* @property {UserResolvable} [user] Only return entries for actions made by this user
|
||||
* @property {AuditLogAction|number} [type] Only return entries for this action type
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fetches audit logs for this guild.
|
||||
* @param {Object} [options={}] Options for fetching audit logs
|
||||
* @param {Snowflake|GuildAuditLogsEntry} [options.before] Limit to entries from before specified entry
|
||||
* @param {number} [options.limit] Limit number of entries
|
||||
* @param {UserResolvable} [options.user] Only show entries involving this user
|
||||
* @param {AuditLogAction|number} [options.type] Only show entries involving this action type
|
||||
* @param {GuildAuditLogsFetchOptions} [options={}] Options for fetching audit logs
|
||||
* @returns {Promise<GuildAuditLogs>}
|
||||
* @example
|
||||
* // Output audit log entries
|
||||
@@ -759,16 +764,21 @@ class Guild extends BaseGuild {
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a user to the guild using OAuth2. Requires the `CREATE_INSTANT_INVITE` permission.
|
||||
* @param {UserResolvable} user User to add to the guild
|
||||
* @param {Object} options Options for the addition
|
||||
* @param {string} options.accessToken An OAuth2 access token for the user with the `guilds.join` scope granted to the
|
||||
* Options used to add a user to a guild using OAuth2.
|
||||
* @typedef {Object} AddGuildMemberOptions
|
||||
* @property {string} accessToken An OAuth2 access token for the user with the `guilds.join` scope granted to the
|
||||
* bot's application
|
||||
* @param {string} [options.nick] Nickname to give the member (requires `MANAGE_NICKNAMES`)
|
||||
* @param {Collection<Snowflake, Role>|RoleResolvable[]} [options.roles] Roles to add to the member
|
||||
* @property {string} [nick] The nickname to give to the member (requires `MANAGE_NICKNAMES`)
|
||||
* @property {Collection<Snowflake, Role>|RoleResolvable[]} [roles] The roles to add to the member
|
||||
* (requires `MANAGE_ROLES`)
|
||||
* @param {boolean} [options.mute] Whether the member should be muted (requires `MUTE_MEMBERS`)
|
||||
* @param {boolean} [options.deaf] Whether the member should be deafened (requires `DEAFEN_MEMBERS`)
|
||||
* @property {boolean} [mute] Whether the member should be muted (requires `MUTE_MEMBERS`)
|
||||
* @property {boolean} [deaf] Whether the member should be deafened (requires `DEAFEN_MEMBERS`)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Adds a user to the guild using OAuth2. Requires the `CREATE_INSTANT_INVITE` permission.
|
||||
* @param {UserResolvable} user The user to add to the guild
|
||||
* @param {AddGuildMemberOptions} options Options for adding the user to the guild
|
||||
* @returns {Promise<GuildMember>}
|
||||
*/
|
||||
async addMember(user, options) {
|
||||
|
||||
Reference in New Issue
Block a user