decord/source/modules/app_channels/AppChannelPermissionUtils.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

85 lines
2.5 KiB
TypeScript

// Module ID: 11610
// Function ID: 11611
// Name: getAppChannelBotUserIdFromApplication
// Dependencies: [4788, 1074, 11611, 1086, 4206, 2]
// Exports: getAppChannelBotUserId, getAppChannelBotUserIdFromApplication, isAppChannelFloorPermission, useAppChannelBotUserId
// Module 11610 (getAppChannelBotUserIdFromApplication)
import fromStringAll from "fromString" /* 1086 */;
import Permissions from "Permissions" /* 4206 */;
import useAppChannelApplication from "useAppChannelApplication" /* 11611 */;
import closure_3 from "addApplication" /* 4788 */;
import { ChannelTypes } from "ME" /* 1074 */;
require = arg1;
const result = require("set").fileFinishedImporting("modules/app_channels/AppChannelPermissionUtils.tsx");
export const getAppChannelBotUserIdFromApplication = function getAppChannelBotUserIdFromApplication(type, bot) {
if (type.type === ChannelTypes.GUILD_APP) {
if (null != type.application_id) {
let id;
if (bot != null) {
bot = bot.bot;
if (bot != null) {
id = bot.id;
}
}
if (id == null) {
id = type.application_id;
}
return id;
}
}
};
export const getAppChannelBotUserId = function getAppChannelBotUserId(c18) {
application = application.getApplication(c18.application_id);
let tmp2;
if (c18.type === ChannelTypes.GUILD_APP) {
if (null != c18.application_id) {
let id;
if (application != null) {
const bot = application.bot;
if (bot != null) {
id = bot.id;
}
}
if (id == null) {
id = c18.application_id;
}
tmp2 = id;
}
}
return tmp2;
};
export const useAppChannelBotUserId = function useAppChannelBotUserId(channel) {
const appChannelApplication = useAppChannelApplication.useAppChannelApplication(channel);
let tmp2;
if (null != channel) {
let tmp4;
if (channel.type === ChannelTypes.GUILD_APP) {
if (null != channel.application_id) {
let id;
if (appChannelApplication != null) {
const bot = appChannelApplication.bot;
if (bot != null) {
id = bot.id;
}
}
if (id == null) {
id = channel.application_id;
}
tmp4 = id;
}
}
tmp2 = tmp4;
}
return tmp2;
};
export const isAppChannelFloorPermission = function isAppChannelFloorPermission(closure_6, id, arg2) {
let hasItem = closure_6 === id;
if (hasItem) {
hasItem = fromStringAll.has(Permissions.APP_CHANNEL_MINIMUM_BOT_PERMISSIONS, arg2);
const obj = fromStringAll;
}
return hasItem;
};