decord/source/modules/app_channels/AppChannelPermissionUtils.tsx
github-actions 67d978d9fb chore: update source for alpha 346.0
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9672_m.js (378.6 MB)
2026-09-07 16:44:02 +00:00

85 lines
2.5 KiB
TypeScript

// Module ID: 11615
// Function ID: 11616
// Name: getAppChannelBotUserIdFromApplication
// Dependencies: [4788, 1074, 11616, 1086, 4206, 2]
// Exports: getAppChannelBotUserId, getAppChannelBotUserIdFromApplication, isAppChannelFloorPermission, useAppChannelBotUserId
// Module 11615 (getAppChannelBotUserIdFromApplication)
import fromStringAll from "fromString" /* 1086 */;
import Permissions from "Permissions" /* 4206 */;
import useAppChannelApplication from "useAppChannelApplication" /* 11616 */;
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;
};