decord/source/modules/threads/native/useCreateThread.tsx

89 lines
3 KiB
TypeScript
Raw Normal View History

2026-07-28 08:39:19 +00:00
// Module ID: 9547
// Function ID: 74370
2026-07-20 16:05:17 +00:00
// Name: useCreateThread
2026-07-28 08:39:19 +00:00
// Dependencies: [5, 31, 4503, 4158, 5497, 6165, 5695, 5948, 6169, 6168, 6132, 4746, 4705, 6170, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, useCreateForumPost
2026-07-28 08:39:19 +00:00
// Module 9547 (useCreateThread)
2026-07-23 10:11:24 +00:00
import getIsPrivate from "getIsPrivate";
import result from "result";
import { DraftType } from "_isNativeReflectConstruct";
import { MessageSendLocation } from "MESSAGE_GROUP_SPACING";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
const result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/threads/native/useCreateThread.tsx");
2026-07-20 16:05:17 +00:00
export default function useCreateThread(arg0) {
let _location;
let onThreadCreated;
let parentChannel;
let parentMessageId;
let privateThreadMode;
let threadSettings;
let useDefaultThreadName;
({ parentChannel, parentMessageId, threadSettings, privateThreadMode, location: _location, onThreadCreated, useDefaultThreadName } = arg0);
2026-07-28 08:39:19 +00:00
const analyticsLocations = importDefault(5497)().analyticsLocations;
let obj = analyticsLocations(6165);
2026-07-20 16:05:17 +00:00
obj = {
parentChannel,
parentMessageId,
threadSettings,
privateThreadMode,
location: _location,
onThreadCreated,
useDefaultThreadName,
uploadHandler(id, attachmentsToUpload) {
2026-07-23 10:11:24 +00:00
let closure_0 = id;
let closure_1 = attachmentsToUpload;
let obj = outer1_1(outer1_2[6]);
2026-07-20 16:05:17 +00:00
obj = {
2026-07-23 10:11:24 +00:00
location: outer1_6.THREAD_CREATION,
2026-07-20 16:05:17 +00:00
attachmentsToUpload,
onAttachmentUploadError(file, code, reason) {
2026-07-23 10:11:24 +00:00
let obj = analyticsLocations(outer2_2[8]);
obj = { file, guildId: guildId.getGuildId(), analyticsLocations: guildId, code, reason };
2026-07-20 16:05:17 +00:00
if (obj.handleUploadMessageAttachmentsErrors(obj)) {
2026-07-23 10:11:24 +00:00
obj = { channelId: guildId.id, uploads: closure_1, draftType: outer2_5.FirstThreadMessage, resetState: true };
outer2_1(outer2_2[9]).setUploads(obj);
const obj3 = outer2_1(outer2_2[9]);
2026-07-20 16:05:17 +00:00
}
}
};
2026-07-23 10:11:24 +00:00
obj.sendMessage(id.id, outer1_1(outer1_2[7]).parse(id, arg2), undefined, obj);
2026-07-20 16:05:17 +00:00
}
};
return obj.useCreateThreadCommon(obj);
};
export const useCreateForumPost = function useCreateForumPost(parentChannel) {
let appliedTags;
let onThreadCreated;
parentChannel = parentChannel.parentChannel;
const threadSettings = parentChannel.threadSettings;
let name;
({ appliedTags, onThreadCreated } = parentChannel);
2026-07-28 08:39:19 +00:00
analyticsLocations = analyticsLocations(5497)().analyticsLocations;
2026-07-20 16:05:17 +00:00
const items = [analyticsLocations, parentChannel];
2026-07-23 10:11:24 +00:00
const callback = React.useCallback((() => {
2026-07-20 16:05:17 +00:00
// CreateGeneratorClosureLongIndex (0x67)
2026-07-23 10:11:24 +00:00
let closure_0 = outer1_3(tmp);
2026-07-20 16:05:17 +00:00
return function() {
return callback(...arguments);
};
2026-07-23 10:11:24 +00:00
})(), items);
2026-07-28 08:39:19 +00:00
let obj = parentChannel(6165);
2026-07-20 16:05:17 +00:00
obj = { parentChannel };
if (null != threadSettings) {
name = threadSettings.name;
}
let str = "";
if (null != name) {
str = name;
}
obj.name = str;
obj.appliedTags = appliedTags;
obj.analyticsLocations = analyticsLocations;
obj.onThreadCreated = onThreadCreated;
obj.upload = callback;
return obj.useCreateForumPostCommon(obj);
};