mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-18 10:57:04 -04:00
Remove getGuildRoles
This commit is contained in:
parent
6e363814d1
commit
6a7657de3f
10 changed files with 30 additions and 32 deletions
|
@ -17,9 +17,8 @@
|
|||
*/
|
||||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { getGuildRoles } from "@utils/discord";
|
||||
import { wordsToTitle } from "@utils/text";
|
||||
import { i18n, Parser } from "@webpack/common";
|
||||
import { GuildStore, i18n, Parser } from "@webpack/common";
|
||||
import { Guild, GuildMember, Role } from "discord-types/general";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
|
@ -69,7 +68,7 @@ export function getPermissionDescription(permission: string): ReactNode {
|
|||
}
|
||||
|
||||
export function getSortedRoles({ id }: Guild, member: GuildMember) {
|
||||
const roles = getGuildRoles(id);
|
||||
const roles = GuildStore.getRoles(id);
|
||||
|
||||
return [...member.roles, id]
|
||||
.map(id => roles[id])
|
||||
|
@ -88,7 +87,7 @@ export function sortUserRoles(roles: Role[]) {
|
|||
}
|
||||
|
||||
export function sortPermissionOverwrites<T extends { id: string; type: number; }>(overwrites: T[], guildId: string) {
|
||||
const roles = getGuildRoles(guildId);
|
||||
const roles = GuildStore.getRoles(guildId);
|
||||
|
||||
return overwrites.sort((a, b) => {
|
||||
if (a.type !== PermissionType.Role || b.type !== PermissionType.Role) return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue