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

32 lines
981 B
TypeScript
Raw Normal View History

2026-10-03 08:58:59 +00:00
// Module ID: 9263
// Function ID: 9264
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-03 08:58:59 +00:00
// Module 9263 (canViewInviteModal)
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
export const canViewInviteModal = function canViewInviteModal(PermissionStore, guild, defaultChannel, stageInstanceByChannel) {
let tmp = defaultChannel;
if (defaultChannel == 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;
};