Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add modify function to the GuildMemberRoleManager for adding/removing roles at once. #10355

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
fix(): address some of the comments
scottbucher committed Jun 19, 2024
commit 344550f5553ff4aa2e19a2b3c1aeb57397a468d6
5 changes: 3 additions & 2 deletions packages/discord.js/src/managers/GuildMemberRoleManager.js
Original file line number Diff line number Diff line change
@@ -162,8 +162,8 @@ class GuildMemberRoleManager extends DataManager {

/**
* Modifies the roles of the member.
* @param {RoleResolvable|RoleResolvable[]|Collection<Snowflake, Role>} rolesToAdd The roles to add
* @param {RoleResolvable|RoleResolvable[]|Collection<Snowflake, Role>} rolesToRemove The roles to remove
* @param {RoleResolvable[]|Collection<Snowflake, Role>} rolesToAdd The roles to add
* @param {RoleResolvable[]|Collection<Snowflake, Role>} rolesToRemove The roles to remove
* @param {string} [reason] Reason for modifying the roles
* @returns {Promise<GuildMember>}
*/
@@ -186,6 +186,7 @@ class GuildMemberRoleManager extends DataManager {
* Resolves roles from the input.
* @param {RoleResolvable[] | Collection<Snowflake, Role>} rolesToResolve The roles to resolve
* @returns {Array} The resolved roles
scottbucher marked this conversation as resolved.
Show resolved Hide resolved
* @private
*/
resolveRoles(rolesToResolve) {
scottbucher marked this conversation as resolved.
Show resolved Hide resolved
const resolvedRoles = [];
2 changes: 1 addition & 1 deletion packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
@@ -4411,7 +4411,7 @@ export class GuildMemberRoleManager extends DataManager<Snowflake, Role, RoleRes
public modify(
rolesToAdd: readonly RoleResolvable[] | ReadonlyCollection<Snowflake, Role>,
scottbucher marked this conversation as resolved.
Show resolved Hide resolved
rolesToRemove: readonly RoleResolvable[] | ReadonlyCollection<Snowflake, Role>,
scottbucher marked this conversation as resolved.
Show resolved Hide resolved
reason?: any
reason?: any,
): Promise<GuildMember>;
public set(
roles: readonly RoleResolvable[] | ReadonlyCollection<Snowflake, Role>,