More rework progress, remove all eris imports
This commit is contained in:
parent
8f7a6510eb
commit
52839cc9f3
181 changed files with 352 additions and 343 deletions
|
@ -5,7 +5,7 @@ import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
|||
import { splitRoleNames } from "../util/splitRoleNames";
|
||||
import { normalizeRoleNames } from "../util/normalizeRoleNames";
|
||||
import { findMatchingRoles } from "../util/findMatchingRoles";
|
||||
import { Role } from "eris";
|
||||
|
||||
import { memberRolesLock } from "../../../utils/lockNameHelpers";
|
||||
|
||||
export const RoleAddCmd = selfGrantableRolesCmd({
|
||||
|
@ -31,7 +31,7 @@ export const RoleAddCmd = selfGrantableRolesCmd({
|
|||
const hasUnknownRoles = matchedRoleIds.length !== roleNames.length;
|
||||
|
||||
const rolesToAdd: Map<string, Role> = Array.from(matchedRoleIds.values())
|
||||
.map(id => pluginData.guild.roles.get(id)!)
|
||||
.map(id => pluginData.guild.roles.cache.get(id)!)
|
||||
.filter(Boolean)
|
||||
.reduce((map, role) => {
|
||||
map.set(role.id, role);
|
||||
|
@ -69,9 +69,9 @@ export const RoleAddCmd = selfGrantableRolesCmd({
|
|||
rolesToAdd.delete(roleId);
|
||||
|
||||
if (msg.member.roles.includes(roleId)) {
|
||||
removed.add(pluginData.guild.roles.get(roleId)!);
|
||||
removed.add(pluginData.guild.roles.cache.get(roleId)!);
|
||||
} else {
|
||||
skipped.add(pluginData.guild.roles.get(roleId)!);
|
||||
skipped.add(pluginData.guild.roles.cache.get(roleId)!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ export const RoleRemoveCmd = selfGrantableRolesCmd({
|
|||
const roleNames = normalizeRoleNames(splitRoleNames(args.roleNames));
|
||||
const matchedRoleIds = findMatchingRoles(roleNames, applyingEntries);
|
||||
|
||||
const rolesToRemove = Array.from(matchedRoleIds.values()).map(id => pluginData.guild.roles.get(id)!);
|
||||
const rolesToRemove = Array.from(matchedRoleIds.values()).map(id => pluginData.guild.roles.cache.get(id)!);
|
||||
const roleIdsToRemove = rolesToRemove.map(r => r.id);
|
||||
|
||||
// Remove the roles
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue