decord/alpha/source/modules/instant_invite/canViewInviteModal.tsx

32 lines
963 B
TypeScript
Raw Normal View History

2026-10-10 08:08:14 +00:00
// Module ID: 8532
// Function ID: 8533
2026-07-20 16:05:17 +00:00
// Name: canViewInviteModal
2026-10-03 08:58:59 +00:00
// Dependencies: [1085, 2]
2026-07-20 16:05:17 +00:00
// Exports: canViewInviteModal
2026-10-10 08:08:14 +00:00
// Module 8532 (canViewInviteModal)
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
const Permissions = Constants.Permissions;
const result = size.fileFinishedImporting("modules/instant_invite/canViewInviteModal.tsx");
2026-07-23 10:11:24 +00:00
2026-10-08 09:57:35 +00:00
export const canViewInviteModal = function canViewInviteModal(PermissionStore, guild, channel1, stageInstanceByChannel) {
let tmp = channel1;
if (channel1 == null) {
2026-07-29 08:29:29 +00:00
tmp = guild;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
let canResult = null != tmp && PermissionStore.can(Permissions.CREATE_INSTANT_INVITE, tmp);
2026-07-20 16:05:17 +00:00
if (!canResult) {
canResult = null != guild && null != guild.vanityURLCode;
}
if (!canResult) {
let invite_code;
2026-07-29 08:29:29 +00:00
if (stageInstanceByChannel != null) {
2026-07-20 16:05:17 +00:00
invite_code = stageInstanceByChannel.invite_code;
}
canResult = null != invite_code;
}
return canResult;
};