Files
discord-decomp/modules/interactions/InteractionActionCreators.tsx
T
2026-11-01 12:12:55 +02:00

66 lines
1.6 KiB
TypeScript

// Metro module 7896 (f7897).
import { Endpoints } from "../../Constants";
import Dispatcher from "../../Dispatcher";
import { HTTP, rejectWithMigratedError } from "../../_bundle/sendRequest";
export function queueInteractionComponentState(a0, a1, a2, a3) {
Dispatcher.dispatch({
type: "QUEUE_INTERACTION_COMPONENT_STATE",
messageId: a0,
nonce: a1,
state: a2,
componentId: a3
});
}
export function addQueued(a0, a1) {
const { data, messageId } = a1;
Dispatcher.dispatch({
type: "INTERACTION_QUEUE",
data,
nonce: a0,
messageId,
preflight: a1.preflight,
onCreate: a1.onCreate,
onSuccess: a1.onSuccess,
onFailure: a1.onFailure
});
}
export function setFailed(a0, a1, a2, a3) {
Dispatcher.dispatch({
type: "INTERACTION_FAILURE",
nonce: a0,
errorMessage: a2,
errorCode: a1,
status: a3
});
}
export async function fetchMessageInteractionData(c26058_0, c26058_1) {
let r72;
let c26058_3;
let c29861_0, c29861_1, c29861_2, c29861_3;
L12: {
c26058_3 = void 0;
c29861_0 = c26058_0;
c29861_1 = c26058_1;
c29861_2 = void 0;
c29861_3 = void 0;
c29861_2 = await HTTP.get({
url: Endpoints.MESSAGE_INTERACTION_DATA(c26058_0, c26058_1),
oldFormErrors: true,
rejectWithError: rejectWithMigratedError()
});
if (c29861_2.ok) {
c29861_3 = c29861_2.body;
Dispatcher.dispatch({
type: "LOAD_MESSAGE_INTERACTION_DATA_SUCCESS",
channelId: c29861_0,
messageId: c29861_1,
interactionData: c29861_3
});
r72 = c29861_3;
break L12;
}
return null;
}
return r72;
}