decord/source/modules/guild_scheduled_events/saveGuildEventRecurrence.tsx

66 lines
2.8 KiB
TypeScript
Raw Normal View History

// Module ID: 9832
// Function ID: 9833
2026-07-20 16:05:17 +00:00
// Name: saveGuildEventRecurrence
// Dependencies: [9795, 9833, 11, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 9832 (saveGuildEventRecurrence)
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
import ScheduleUtils from "ScheduleUtils" /* 9795 */;
import GuildScheduledEventsActionCreatorsDefault from "GuildScheduledEventsActionCreators" /* 9833 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
let result = size.fileFinishedImporting("modules/guild_scheduled_events/saveGuildEventRecurrence.tsx");
2026-07-20 16:05:17 +00:00
2026-08-27 16:17:25 +00:00
export default function saveGuildEventRecurrence(guild_id, nextRecurrenceIdInEvent, startDate, event_exception_id) {
const baseScheduleForRecurrence = ScheduleUtils.getBaseScheduleForRecurrence(nextRecurrenceIdInEvent, guild_id);
2026-07-20 16:05:17 +00:00
startDate = null;
if (!obj2.areDatesIdentical(baseScheduleForRecurrence.startDate, startDate.startDate)) {
startDate = startDate.startDate;
}
obj2 = ScheduleUtils;
2026-07-20 16:05:17 +00:00
let endDate = null;
2026-07-29 08:29:29 +00:00
if (!tmpResult.areDatesIdentical(baseScheduleForRecurrence.endDate, startDate.endDate)) {
2026-07-20 16:05:17 +00:00
endDate = startDate.endDate;
}
if (null != event_exception_id) {
const result = tmp(9795).areSchedulesIdentical(startDate, baseScheduleForRecurrence);
const obj5 = GuildScheduledEventsActionCreatorsDefault;
2026-07-20 16:05:17 +00:00
if (result) {
let result1 = obj5.deleteGuildEventException(guild_id.guild_id, guild_id.id, event_exception_id.event_exception_id);
} else {
let toISOStringResult;
2026-07-29 08:29:29 +00:00
if (startDate != null) {
2026-07-20 16:05:17 +00:00
toISOStringResult = startDate.toISOString();
}
const obj3 = { scheduled_start_time: toISOStringResult, scheduled_end_time: null, is_canceled: null };
2026-07-20 16:05:17 +00:00
let toISOStringResult1;
2026-07-29 08:29:29 +00:00
if (endDate != null) {
2026-07-20 16:05:17 +00:00
toISOStringResult1 = endDate.toISOString();
}
obj3.scheduled_end_time = toISOStringResult1;
obj3.is_canceled = event_exception_id.is_canceled;
result1 = obj5.updateGuildEventException(obj3, guild_id.guild_id, guild_id.id, nextRecurrenceIdInEvent);
2026-07-20 16:05:17 +00:00
}
return result1;
} else {
const extractTimestampResult = SnowflakeUtilsDefault.extractTimestamp(nextRecurrenceIdInEvent);
const obj4 = { original_scheduled_start_time: null, scheduled_start_time: null, scheduled_end_time: null, is_canceled: false };
2026-07-20 16:05:17 +00:00
const _Date = Date;
const date = new Date(extractTimestampResult);
obj4.original_scheduled_start_time = date.toISOString();
2026-07-20 16:05:17 +00:00
let toISOStringResult2;
2026-07-29 08:29:29 +00:00
if (startDate != null) {
2026-07-20 16:05:17 +00:00
toISOStringResult2 = startDate.toISOString();
}
obj4.scheduled_start_time = toISOStringResult2;
2026-07-20 16:05:17 +00:00
let toISOStringResult3;
2026-07-29 08:29:29 +00:00
if (endDate != null) {
2026-07-20 16:05:17 +00:00
toISOStringResult3 = endDate.toISOString();
}
obj4.scheduled_end_time = toISOStringResult3;
return GuildScheduledEventsActionCreatorsDefault.createGuildEventException(obj4, guild_id.guild_id, guild_id.id);
2026-07-20 16:05:17 +00:00
}
tmpResult = ScheduleUtils;
2026-07-20 16:05:17 +00:00
};