Files
discord-decomp/actions/ChannelFollowerActionCreators.tsx
T
2026-11-01 12:12:55 +02:00

75 lines
1.9 KiB
TypeScript

// Metro module 9880 (f9881).
import { Endpoints } from "../Constants";
import { HTTP, rejectWithMigratedError } from "../_bundle/sendRequest";
import Dispatcher from "../Dispatcher";
const r18 = {
createChannelFollower: (a0, a1) => HTTP.post({
url: Endpoints.CHANNEL_FOLLOWERS(a1),
body: {
webhook_channel_id: a0
},
oldFormErrors: true,
rejectWithError: rejectWithMigratedError()
}),
fetchChannelFollowerStats: async (channel_id) => {
let c26555_3 = 0;
let c30152_0;
L10: {
try {
c30152_0 = void 0;
Dispatcher.dispatch({
type: "CHANNEL_FOLLOWER_STATS_FETCH_START"
});
c26555_3 = 1;
c30152_0 = await HTTP.get({
url: Endpoints.CHANNEL_FOLLOWER_STATS(channel_id),
body: {
channel_id
},
oldFormErrors: true,
rejectWithError: true
});
Dispatcher.dispatch({
type: "CHANNEL_FOLLOWER_STATS_FETCH_SUCCESS",
stats: c30152_0.body,
channelId: channel_id
});
c26555_3 = 0;
} catch ($e) {
let r8 = $e;
if (c26555_3 !== 0) {
while (true) {
try {
c26555_3 = 0;
Dispatcher.dispatch({
type: "CHANNEL_FOLLOWER_STATS_FETCH_FAILURE",
channelId: channel_id
});
break L10;
} catch ($e) {
r8 = $e;
if (c26555_3 === 0) {
break;
}
}
}
}
throw r8;
}
}
},
dismissPublishBump: (a0) => {
Dispatcher.dispatch({
type: "CHANNEL_FOLLOWING_PUBLISH_BUMP_DISMISSED",
messageId: a0
});
},
permanentlyHidePublishBump: (a0) => {
Dispatcher.dispatch({
type: "CHANNEL_FOLLOWING_PUBLISH_BUMP_HIDE_PERMANENTLY",
channelId: a0
});
}
};
export default r18;