Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5030.js (118.4 MB)
100 lines
3.3 KiB
TypeScript
100 lines
3.3 KiB
TypeScript
// Module ID: 16532
|
|
// Function ID: 16533
|
|
// Name: openVibegrationsPublishDestination
|
|
// Dependencies: [5072, 4496, 1372, 1074, 8691, 4858, 1101, 6947, 8975, 8952, 2]
|
|
// Exports: openVibegrationsProductionDm, openVibegrationsPublishDestination
|
|
|
|
// Module 16532 (openVibegrationsPublishDestination)
|
|
import router_utils from "router_utils" /* 1101 */;
|
|
import ChannelActionCreatorsDefault from "ChannelActionCreators" /* 4858 */;
|
|
import transitionToGuild from "transitionToGuild" /* 6947 */;
|
|
import FramesActionCreatorsDefault from "FramesActionCreators" /* 8952 */;
|
|
import canLaunchFrame from "canLaunchFrame" /* 8975 */;
|
|
import ApplicationStore from "ApplicationStore" /* 5072 */;
|
|
import GuildChannelStore from "GuildChannelStore" /* 4496 */;
|
|
import UserStore from "UserStore" /* 1372 */;
|
|
|
|
require = fn;
|
|
const Routes = fn(1074).Routes;
|
|
const MAIN_SURFACE = fn(8691).MAIN_SURFACE;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/vibegrations/lib/openVibegrationsPublishDestination.tsx");
|
|
|
|
export const openVibegrationsProductionDm = function openVibegrationsProductionDm(arg0) {
|
|
const application = ApplicationStore.getApplication(arg0);
|
|
let recipientIds;
|
|
if (application != null) {
|
|
const bot = application.bot;
|
|
if (bot != null) {
|
|
recipientIds = bot.id;
|
|
}
|
|
}
|
|
if (recipientIds == null) {
|
|
recipientIds = arg0;
|
|
}
|
|
return ChannelActionCreatorsDefault.openPrivateChannel({ recipientIds });
|
|
};
|
|
export const openVibegrationsPublishDestination = function openVibegrationsPublishDestination(destination, arg1) {
|
|
({ applicationId, guildId, appChannelId, openAutomodSettings } = arg1);
|
|
if ("launch" === destination) {
|
|
if (obj.canLaunchFrame(ApplicationStore.getApplication(applicationId))) {
|
|
const obj6 = { applicationId, surface: MAIN_SURFACE };
|
|
FramesActionCreatorsDefault.launchFrame(obj6).catch(() => {
|
|
|
|
});
|
|
return Promise.resolve();
|
|
}
|
|
obj = canLaunchFrame;
|
|
} else if ("profile" === destination) {
|
|
const currentUser = UserStore.getCurrentUser();
|
|
let id;
|
|
if (currentUser != null) {
|
|
id = currentUser.id;
|
|
}
|
|
if (null != id) {
|
|
tmp(id);
|
|
return Promise.resolve();
|
|
}
|
|
} else if ("channel" === destination) {
|
|
if (null != guildId) {
|
|
if (null != appChannelId) {
|
|
router_utils.transitionTo(Routes.CHANNEL(guildId, appChannelId));
|
|
return Promise.resolve();
|
|
}
|
|
}
|
|
} else if ("automod" === destination) {
|
|
if (null != guildId) {
|
|
if (null != openAutomodSettings) {
|
|
openAutomodSettings(guildId);
|
|
return Promise.resolve();
|
|
}
|
|
}
|
|
}
|
|
if ("dm" !== destination) {
|
|
if (null != guildId) {
|
|
const defaultChannel = GuildChannelStore.getDefaultChannel(guildId);
|
|
let id1;
|
|
if (defaultChannel != null) {
|
|
id1 = defaultChannel.id;
|
|
}
|
|
if (null == id1) {
|
|
transitionToGuild.transitionToGuild(guildId);
|
|
} else {
|
|
router_utils.transitionTo(Routes.CHANNEL(guildId, id1));
|
|
}
|
|
const resolved = Promise.resolve();
|
|
}
|
|
}
|
|
const application = ApplicationStore.getApplication(applicationId);
|
|
let recipientIds;
|
|
if (application != null) {
|
|
const bot = application.bot;
|
|
if (bot != null) {
|
|
recipientIds = bot.id;
|
|
}
|
|
}
|
|
if (recipientIds == null) {
|
|
recipientIds = applicationId;
|
|
}
|
|
return ChannelActionCreatorsDefault.openPrivateChannel({ recipientIds });
|
|
};
|