mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-17 10:27:03 -04:00
Add workaround for guild role api changes on canary/ptb
fixes RoleColorEverywhere, ServerInfo, PermissionViewer, BetterRoleContext
This commit is contained in:
parent
497f0de9a1
commit
34390e0365
8 changed files with 35 additions and 18 deletions
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { Devs } from "@utils/constants";
|
||||
import { getCurrentGuild } from "@utils/discord";
|
||||
import { getCurrentGuild, getGuildRoles } from "@utils/discord";
|
||||
import definePlugin from "@utils/types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { Clipboard, Menu, PermissionStore, TextAndImagesSettingsStores } from "@webpack/common";
|
||||
|
@ -47,7 +47,9 @@ export default definePlugin({
|
|||
contextMenus: {
|
||||
"dev-context"(children, { id }: { id: string; }) {
|
||||
const guild = getCurrentGuild();
|
||||
const role = guild?.roles[id];
|
||||
if (!guild) return;
|
||||
|
||||
const role = getGuildRoles(guild.id)[id];
|
||||
if (!role) return;
|
||||
|
||||
if (role.colorString) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue