Files
discord-decomp/sources/actions/WebhooksActionCreators.tsx
T
2026-07-27 16:20:00 +03:00

125 lines
6.7 KiB
TypeScript

/* Metro module 15205; source: actions/WebhooksActionCreators.tsx; dependencies: [661, 694, 507, 22, 2] */
function _fun116293(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:6, offset: 0x02484034, size: 191 bytes, params: 8, frame: 18
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(661) /* metro dependency 661: Constants */).Endpoints;
const env0_4 = ['Spidey Bot', 'Captain Hook'];
object2 = {fetchForGuild: fetchForGuild, fetchForChannel: fetchForChannel, create: create_116300,
delete: _fun116302, update: update_116304};
(require(2) /* metro dependency 2 */).fileFinishedImporting('actions/WebhooksActionCreators.tsx');
exports.default = object2;
}
function fetchForGuild(a0) { // fn#116294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:151, offset: 0x024840f3, size: 159 bytes, params: 2, frame: 17
var object2;
const env0_0 = a0;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'WEBHOOKS_FETCHING', guildId: a0});
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const get = HTTP.get;
object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
object2.url = Endpoints.GUILD_WEBHOOKS(a0);
let value = Reflect.apply(get, HTTP, [object2]);
value = value.then(_fun116295);
value.catch(_fun116296);
}
function fetchForChannel(a0, a1) { // fn#116297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:480, offset: 0x02484228, size: 170 bytes, params: 3, frame: 18
var object2;
const env0_0 = a0;
const env0_1 = a1;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'WEBHOOKS_FETCHING', guildId: a0,
channelId: a1});
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const get = HTTP.get;
object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': true};
object2.url = Endpoints.CHANNEL_WEBHOOKS(a1);
let value = Reflect.apply(get, HTTP, [object2]);
value = value.then(_fun116298);
value.catch(_fun116299);
}
function create_116300(a0, a1, a2) { // fn#116300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:846, offset: 0x02484323, size: 184 bytes, params: 4, frame: 17
var r5;
var binding;
let value = a2;
const env0_0 = a0;
if (value != null) {
r5 = value;
} else {
binding = env0_4;
value = importDefault(22) /* metro dependency 22 */;
r5 = binding[value.random(0, binding.length - 1)];
}
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const post = HTTP.post;
const object2 = {};
object2.url = Endpoints.CHANNEL_WEBHOOKS(a1);
object2.body = {name: r5};
object2.oldFormErrors = true;
object2.rejectWithError = false;
return Reflect.apply(post, HTTP, [object2]).then(_fun116301);
}
function _fun116302(a0, a1) { // fn#116302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:1092, offset: 0x02484422, size: 107 bytes, params: 3, frame: 15
const env0_0 = a0;
const env0_1 = a1;
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const del = HTTP.del;
const object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
object2.url = Endpoints.WEBHOOK(a1);
return Reflect.apply(del, HTTP, [object2]).then(_fun116303);
}
function update_116304(a0, a1, a2) { // fn#116304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:1257, offset: 0x024844d0, size: 113 bytes, params: 4, frame: 15
const env0_0 = a0;
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const patch = HTTP.patch;
const object2 = {};
object2.url = Endpoints.WEBHOOK(a1);
object2.body = a2;
object2.oldFormErrors = true;
object2.rejectWithError = false;
return Reflect.apply(patch, HTTP, [object2]).then(_fun116305);
}
function _fun116295({body}) { // fn#116295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:309, offset: 0x02484192, size: 73 bytes, params: 2, frame: 13
const value = environment.__proto__;
return (importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'WEBHOOKS_UPDATE',
guildId: env0_0, webhooks: body});
}
function _fun116296({body}) { // fn#116296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:394, offset: 0x024841db, size: 77 bytes, params: 2, frame: 14
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'WEBHOOKS_UPDATE', guildId: env0_0,
error: body.message});
}
function _fun116298({body}) { // fn#116298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:656, offset: 0x024842d2, size: 81 bytes, params: 2, frame: 14
const value = environment.__proto__;
return (importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'WEBHOOKS_UPDATE',
guildId: env0_0, channelId: require, webhooks: body});
}
function _fun116301({body}) { // fn#116301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:1004, offset: 0x024843db, size: 71 bytes, params: 2, frame: 13
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'WEBHOOK_CREATE', guildId: env0_0,
webhook: body});
return body;
}
function _fun116303() { // fn#116303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:1178, offset: 0x0248448d, size: 67 bytes, params: 1, frame: 14
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'WEBHOOK_DELETE', guildId: env0_0,
webhookId: require});
}
function _fun116305({body}) { // fn#116305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:1354, offset: 0x02484541, size: 71 bytes, params: 2, frame: 13
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'WEBHOOK_UPDATE', guildId: env0_0,
webhook: body});
return body;
}