decord/source/actions/CreateChannelActionCreators.tsx

191 lines
5.9 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 9142
// Function ID: 9143
// Dependencies: [4589, 676, 685, 709, 4601, 503, 1404, 530, 5368, 5363, 6047, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 9142
2026-08-24 06:08:38 +00:00
import encodeProperties from "encodeProperties" /* 503 */;
import sendRequest from "sendRequest" /* 530 */;
2026-08-25 06:04:03 +00:00
import _modDef4601 from "module_4601" /* 4601 */;
import closure_3 from "updateUserGuildSettingsInternal" /* 4589 */;
2026-08-24 06:08:38 +00:00
import ME from "ME" /* 676 */;
import { ChannelNotificationSettingsFlags as closure_7 } from "MAX_FAVORITES" /* 685 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
({ BITRATE_DEFAULT: c4, ChannelTypes: c5, Endpoints: closure_6 } = ME);
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("actions/CreateChannelActionCreators.tsx");
2026-07-23 10:11:24 +00:00
export default {
2026-07-20 16:05:17 +00:00
createChannel(guildId) {
guildId = guildId.guildId;
({ type, permissionOverwrites } = guildId);
if (permissionOverwrites === undefined) {
permissionOverwrites = [];
}
2026-08-07 06:50:47 +00:00
({ bitrate, userLimit, parentId, skuId, flags, availableTags, gameId } = guildId);
2026-07-29 08:29:29 +00:00
let obj = permissionOverwrites(709);
2026-07-20 16:05:17 +00:00
obj.dispatch({ type: "CREATE_CHANNEL_MODAL_SUBMIT", guildId, channelType: type });
obj = { type, name: guildId.name, permission_overwrites: permissionOverwrites };
2026-07-29 08:29:29 +00:00
let tmp4 = null != bitrate;
if (tmp4) {
tmp4 = bitrate !== closure_4;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
2026-07-20 16:05:17 +00:00
obj.bitrate = bitrate;
}
2026-07-29 08:29:29 +00:00
let tmp6 = null != userLimit;
if (tmp6) {
tmp6 = userLimit > 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp6) {
2026-07-20 16:05:17 +00:00
obj.user_limit = userLimit;
}
if (null != parentId) {
obj.parent_id = parentId;
}
if (null != flags) {
obj.flags = flags;
}
2026-07-29 08:29:29 +00:00
let tmp7 = null != availableTags;
if (tmp7) {
tmp7 = availableTags.length > 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp7) {
2026-07-20 16:05:17 +00:00
obj.available_tags = availableTags.map((name) => ({ name: name.name, emoji_id: name.emojiId, emoji_name: name.emojiName, moderated: name.moderated }));
}
2026-08-07 06:50:47 +00:00
if (null != gameId) {
obj.game_id = gameId;
}
2026-07-20 16:05:17 +00:00
if (type === constants.GUILD_STORE) {
if (null == skuId) {
const _Error = Error;
2026-08-24 06:08:38 +00:00
error = new Error("Unexpected missing SKU");
2026-07-20 16:05:17 +00:00
throw error;
} else {
obj.sku_id = skuId;
obj.branch_id = guildId.branchId;
}
}
2026-07-29 08:29:29 +00:00
obj = { url: closure_6.GUILD_CHANNELS(guildId), body: obj, oldFormErrors: true, trackedActionData: null, rejectWithError: null };
const tmp = permissionOverwrites;
2026-08-25 06:04:03 +00:00
const tmpResult = permissionOverwrites(4601);
2026-07-29 08:29:29 +00:00
obj[3] = {
event: guildId(503).NetworkActionNames.CHANNEL_CREATE,
2026-07-20 16:05:17 +00:00
properties(body) {
2026-08-24 06:08:38 +00:00
let obj = guildId(closure_1_2[6]);
2026-07-29 08:29:29 +00:00
obj = { is_private: permissionOverwrites.length > 0, channel_id: null, channel_type: null };
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
body = body.body;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
id = body.id;
}
}
2026-07-29 08:29:29 +00:00
obj[1] = id;
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
const body2 = body.body;
2026-07-29 08:29:29 +00:00
if (body2 != null) {
2026-07-20 16:05:17 +00:00
type = body2.type;
}
}
2026-07-29 08:29:29 +00:00
obj[2] = type;
2026-07-20 16:05:17 +00:00
return obj.exact(obj);
}
};
2026-08-24 06:08:38 +00:00
obj1 = {
2026-07-29 08:29:29 +00:00
event: guildId(503).NetworkActionNames.CHANNEL_CREATE,
2026-07-20 16:05:17 +00:00
properties(body) {
2026-08-24 06:08:38 +00:00
let obj = guildId(closure_1_2[6]);
2026-07-29 08:29:29 +00:00
obj = { is_private: permissionOverwrites.length > 0, channel_id: null, channel_type: null };
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
body = body.body;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
id = body.id;
}
}
2026-07-29 08:29:29 +00:00
obj[1] = id;
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
const body2 = body.body;
2026-07-29 08:29:29 +00:00
if (body2 != null) {
2026-07-20 16:05:17 +00:00
type = body2.type;
}
}
2026-07-29 08:29:29 +00:00
obj[2] = type;
2026-07-20 16:05:17 +00:00
return obj.exact(obj);
}
};
2026-07-29 08:29:29 +00:00
obj[4] = guildId(530).rejectWithMigratedError();
const obj6 = guildId(530);
return tmpResult.post(obj).then((body) => {
2026-08-24 06:08:38 +00:00
if (closure_1_3.isOptInEnabled(guildId)) {
let obj = permissionOverwrites(closure_1_2[8]);
2026-07-29 08:29:29 +00:00
obj = { flags: null };
2026-08-24 06:08:38 +00:00
obj[0] = closure_1_7.OPT_IN_ENABLED;
const result = obj.updateChannelOverrideSettings(tmp, body.body.id, obj, guildId(closure_1_2[9]).NotificationLabels.OptedIn);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const result1 = permissionOverwrites(closure_1_2[10]).checkGuildTemplateDirty(tmp);
2026-07-20 16:05:17 +00:00
return body;
}, (body) => {
2026-07-29 08:29:29 +00:00
let obj = permissionOverwrites(table[3]);
2026-07-20 16:05:17 +00:00
obj = { type: "CREATE_CHANNEL_MODAL_SUBMIT_FAILURE", errors: body.body };
obj.dispatch(obj);
throw body;
});
},
createRoleSubscriptionTemplateChannel(closure_0, name, type, topic) {
2026-08-25 06:04:03 +00:00
let obj = _modDef4601;
2026-07-29 08:29:29 +00:00
obj = { url: closure_6.GUILD_CHANNELS(closure_0), body: obj, oldFormErrors: true, trackedActionData: null, rejectWithError: null };
obj = { name, type, topic };
obj[3] = {
2026-08-24 06:08:38 +00:00
event: encodeProperties.NetworkActionNames.CHANNEL_CREATE,
2026-07-29 08:29:29 +00:00
properties(body) {
let obj = callback(table[6]);
let id;
if (body != null) {
body = body.body;
if (body != null) {
id = body.id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
obj = { is_private: true, channel_id: id, channel_type: null };
let type;
if (body != null) {
const body2 = body.body;
if (body2 != null) {
type = body2.type;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj[2] = type;
return obj.exact(obj);
2026-07-20 16:05:17 +00:00
}
};
2026-08-24 06:08:38 +00:00
obj1 = {
event: encodeProperties.NetworkActionNames.CHANNEL_CREATE,
2026-07-20 16:05:17 +00:00
properties(body) {
2026-07-29 08:29:29 +00:00
let obj = callback(table[6]);
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
body = body.body;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
id = body.id;
}
}
2026-07-29 08:29:29 +00:00
obj = { is_private: true, channel_id: id, channel_type: null };
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (body != null) {
2026-07-20 16:05:17 +00:00
const body2 = body.body;
2026-07-29 08:29:29 +00:00
if (body2 != null) {
2026-07-20 16:05:17 +00:00
type = body2.type;
}
}
2026-07-29 08:29:29 +00:00
obj[2] = type;
2026-07-20 16:05:17 +00:00
return obj.exact(obj);
}
};
2026-08-24 06:08:38 +00:00
obj[4] = sendRequest.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return obj.post(obj);
}
};