decord/source/actions/CreateChannelActionCreators.tsx

200 lines
6 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 8848
// Function ID: 8849
// Dependencies: [5043, 676, 685, 709, 5227, 503, 1404, 530, 6798, 6795, 7286, 2]
2026-07-20 16:05:17 +00:00
2026-08-15 05:55:55 +00:00
// Module 8848
2026-07-29 08:29:29 +00:00
import updateUserGuildSettingsInternal from "updateUserGuildSettingsInternal";
2026-07-23 10:11:24 +00:00
import ME from "ME";
import { ChannelNotificationSettingsFlags as closure_7 } from "MAX_FAVORITES";
2026-07-29 08:29:29 +00:00
let c4;
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
const require = arg1;
2026-07-29 08:29:29 +00:00
({ BITRATE_DEFAULT: c4, ChannelTypes: c5, Endpoints: closure_6 } = ME);
2026-07-23 10:11:24 +00:00
let result = require("MAX_FAVORITES").fileFinishedImporting("actions/CreateChannelActionCreators.tsx");
export default {
2026-07-20 16:05:17 +00:00
createChannel(guildId) {
let availableTags;
let bitrate;
let flags;
2026-08-07 06:50:47 +00:00
let gameId;
2026-07-20 16:05:17 +00:00
let parentId;
let permissionOverwrites;
let skuId;
let type;
let userLimit;
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;
const error = new Error("Unexpected missing SKU");
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-15 05:55:55 +00:00
const tmpResult = permissionOverwrites(5227);
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-07-23 10:11:24 +00:00
let obj = guildId(outer1_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);
}
};
const 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-07-23 10:11:24 +00:00
let obj = guildId(outer1_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-07-23 10:11:24 +00:00
if (outer1_3.isOptInEnabled(guildId)) {
let obj = permissionOverwrites(outer1_2[8]);
2026-07-29 08:29:29 +00:00
obj = { flags: null };
obj[0] = outer1_7.OPT_IN_ENABLED;
const result = obj.updateChannelOverrideSettings(tmp, body.body.id, obj, guildId(outer1_2[9]).NotificationLabels.OptedIn);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const result1 = permissionOverwrites(outer1_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-15 05:55:55 +00:00
let obj = importDefault(5227);
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] = {
event: require(503) /* encodeProperties */.NetworkActionNames.CHANNEL_CREATE,
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
}
};
const obj1 = {
2026-07-29 08:29:29 +00:00
event: require(503) /* 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-07-29 08:29:29 +00:00
obj[4] = require(530) /* sendRequest */.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return obj.post(obj);
}
};