Remove getGuildRoles
This commit is contained in:
parent
6e363814d1
commit
6a7657de3f
10 changed files with 30 additions and 32 deletions
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
import { MessageObject } from "@api/MessageEvents";
|
||||
import { ChannelStore, ComponentDispatch, FluxDispatcher, GuildStore, InviteActions, MaskedLink, MessageActions, ModalImageClasses, PrivateChannelsStore, RestAPI, SelectedChannelStore, SelectedGuildStore, UserProfileActions, UserProfileStore, UserSettingsActionCreators, UserUtils } from "@webpack/common";
|
||||
import { Guild, Message, Role, User } from "discord-types/general";
|
||||
import { Guild, Message, User } from "discord-types/general";
|
||||
|
||||
import { ImageModal, ModalRoot, ModalSize, openModal } from "./modal";
|
||||
|
||||
|
|
@ -185,11 +185,3 @@ export async function fetchUserProfile(id: string, options?: FetchUserProfileOpt
|
|||
export function getUniqueUsername(user: User) {
|
||||
return user.discriminator === "0" ? user.username : user.tag;
|
||||
}
|
||||
|
||||
// FIXME: remove this once discord merges the role change into stable
|
||||
export function getGuildRoles(guildId: string): Record<string, Role> {
|
||||
if ("getRoles" in GuildStore)
|
||||
return (GuildStore as any).getRoles(guildId);
|
||||
|
||||
return GuildStore.getGuild(guildId)?.roles ?? {};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue