mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 06:03:03 -04:00
PauseInvitesForever: Avoid adding button if missing permissions (#3306)
This commit is contained in:
parent
71f352a611
commit
4f11316a8b
1 changed files with 9 additions and 3 deletions
|
@ -20,11 +20,17 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import { getIntlMessage } from "@utils/discord";
|
import { getIntlMessage } from "@utils/discord";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { Constants, GuildStore, RestAPI } from "@webpack/common";
|
import { Constants, GuildStore, PermissionStore, RestAPI } from "@webpack/common";
|
||||||
|
|
||||||
function showDisableInvites(guildId: string) {
|
function showDisableInvites(guildId: string) {
|
||||||
// @ts-ignore
|
const guild = GuildStore.getGuild(guildId);
|
||||||
return !GuildStore.getGuild(guildId).hasFeature("INVITES_DISABLED");
|
if (!guild) return false;
|
||||||
|
|
||||||
|
return (
|
||||||
|
// @ts-ignore
|
||||||
|
!guild.hasFeature("INVITES_DISABLED") &&
|
||||||
|
PermissionStore.getGuildPermissionProps(guild).canManageRoles
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableInvites(guildId: string) {
|
function disableInvites(guildId: string) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue