decord/source/modules/app_dms/useAppDMChatInputState.tsx

158 lines
4.3 KiB
TypeScript
Raw Normal View History

2026-07-28 08:39:19 +00:00
// Module ID: 10113
// Function ID: 78213
2026-07-20 16:05:17 +00:00
// Name: items
2026-07-28 08:39:19 +00:00
// Dependencies: [31, 5679, 4202, 5878, 4188, 1850, 653, 1882, 566, 7959, 686, 5503, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-28 08:39:19 +00:00
// Module 10113 (items)
2026-07-23 10:11:24 +00:00
import result from "result";
import { useQueryState } from "_isNativeReflectConstruct";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_6 from "_isNativeReflectConstruct";
import _callSuper from "_callSuper";
import closure_8 from "_isNativeReflectConstruct";
import { EMPTY_STRING_SNOWFLAKE_ID } from "ME";
const require = arg1;
let items = [require("PermissionOverwriteType").ApplicationCommandType.PRIMARY_ENTRY_POINT, require("PermissionOverwriteType").ApplicationCommandType.CHAT, require("PermissionOverwriteType").ApplicationCommandType.MESSAGE, require("PermissionOverwriteType").ApplicationCommandType.USER];
const result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/app_dms/useAppDMChatInputState.tsx");
2026-07-20 16:05:17 +00:00
export default function useAppDMChatInputState(context) {
let dependencyMap;
2026-07-23 10:11:24 +00:00
let application;
2026-07-20 16:05:17 +00:00
const channel = context.context.channel;
const items = [channel];
2026-07-23 10:11:24 +00:00
const memo = application.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (null != channel) {
if (true === channel.isDM()) {
2026-07-23 10:11:24 +00:00
const user = outer1_8.getUser(channel.getRecipientId());
2026-07-20 16:05:17 +00:00
let tmp5 = null;
if (undefined !== user) {
tmp5 = null;
if (true === user.bot) {
tmp5 = user;
}
}
return tmp5;
}
}
return null;
}, items);
2026-07-23 10:11:24 +00:00
let obj = channel(566);
const items1 = [_isNativeReflectConstruct];
2026-07-20 16:05:17 +00:00
const stateFromStores = obj.useStateFromStores(items1, () => {
let id;
if (null != memo) {
id = memo.id;
}
2026-07-23 10:11:24 +00:00
return outer1_5.getAppIdForBotUserId(id);
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
let obj1 = channel(566);
2026-07-20 16:05:17 +00:00
const items2 = [closure_6];
const stateFromStores1 = obj1.useStateFromStores(items2, () => {
let tmp;
if (null !== memo) {
let id;
if (null != memo) {
id = memo.id;
}
2026-07-23 10:11:24 +00:00
const userProfile = outer1_6.getUserProfile(id);
2026-07-20 16:05:17 +00:00
let application;
if (null != userProfile) {
application = userProfile.application;
}
tmp = application;
}
return tmp;
});
let tmp4 = stateFromStores;
if (null == stateFromStores) {
let id;
if (null != stateFromStores1) {
id = stateFromStores1.id;
}
tmp4 = id;
}
dependencyMap = tmp4;
const items3 = [memo, tmp4];
2026-07-23 10:11:24 +00:00
const effect = application.useEffect(() => {
if (null == _undefined) {
2026-07-20 16:05:17 +00:00
let id;
if (null != memo) {
id = memo.id;
}
if (null == id) {
2026-07-23 10:11:24 +00:00
id = outer1_9;
2026-07-20 16:05:17 +00:00
}
const obj = { withMutualGuilds: true };
2026-07-23 10:11:24 +00:00
memo(_undefined[9])(id, undefined, obj);
const tmp3 = memo(_undefined[9]);
2026-07-20 16:05:17 +00:00
}
}, items3);
let id1;
if (null != memo) {
id1 = memo.id;
}
const items4 = [id1];
2026-07-23 10:11:24 +00:00
const effect1 = application.useEffect(() => {
2026-07-20 16:05:17 +00:00
let id;
if (null != memo) {
id = memo.id;
}
if (null != id) {
2026-07-23 10:11:24 +00:00
let obj = memo(_undefined[10]);
2026-07-20 16:05:17 +00:00
obj = { type: "APP_DM_OPEN", botUserId: memo.id };
obj.dispatch(obj);
}
}, items4);
obj = { commandTypes: items };
obj = { applicationId: tmp4 };
let id2;
if (null != memo) {
id2 = memo.id;
}
obj.allowFetch = null != id2;
obj.allowApplicationState = true;
const descriptors = useQueryState({ channel, type: "channel" }, obj, obj).descriptors;
const found = descriptors.find((application) => {
application = application.application;
let id;
if (null != application) {
id = application.id;
}
2026-07-23 10:11:24 +00:00
return id === c2;
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
application = undefined;
2026-07-20 16:05:17 +00:00
if (null != found) {
application = found.application;
}
const items5 = [application];
2026-07-23 10:11:24 +00:00
const memo1 = application.useMemo(() => {
2026-07-20 16:05:17 +00:00
let fromServer;
if (null != application) {
2026-07-23 10:11:24 +00:00
fromServer = outer1_7.createFromServer(application);
2026-07-20 16:05:17 +00:00
}
return fromServer;
}, items5);
let tmp15;
if (null == memo1) {
tmp15 = tmp4;
}
2026-07-28 08:39:19 +00:00
let getOrFetchApplication = channel(5503).useGetOrFetchApplication(tmp15);
2026-07-20 16:05:17 +00:00
obj1 = {};
if (null != memo1) {
getOrFetchApplication = memo1;
}
let tmp17;
if (null != getOrFetchApplication) {
tmp17 = getOrFetchApplication;
}
obj1.application = tmp17;
let bot;
if (null != memo) {
bot = memo.bot;
}
obj1.isAppDM = null != bot && bot;
return obj1;
};