Skip to content

Commit

Permalink
fix: not being able to leave/join roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobiah committed May 27, 2020
1 parent 9e6f458 commit 5aeed39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/commands/Roles/JoinRole.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const getRoleForString = (string, message) => {
const roleFromId = message.guild.roles.cache.get(trimmedString);
let roleFromName;
if (typeof roleFromId === 'undefined') {
roleFromName = message.guild.roles
roleFromName = message.guild.roles.cache
.find(item => item.name.toLowerCase() === trimmedString.toLowerCase());
}
return roleFromId || roleFromName || null;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/Roles/LeaveRole.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Command = require('../../models/Command.js');
* @param {Message} message originating message
* @returns {Role|null} Role
*/
function getRoleForString(string, message) {
const getRoleForString = (string, message) => {
const trimmedString = string.trim();
const roleFromId = message.guild.roles.cache.get(trimmedString);
let roleFromName;
Expand All @@ -17,7 +17,7 @@ function getRoleForString(string, message) {
.find(item => item.name.toLowerCase() === trimmedString.toLowerCase());
}
return roleFromId || roleFromName || null;
}
};

/**
* Determine the reason a user can't leave a role
Expand Down

0 comments on commit 5aeed39

Please sign in to comment.