decord/source/stores/WebhooksStore.tsx

154 lines
4.4 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 15583
// Function ID: 120181
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-25 08:10:48 +00:00
// Dependencies: [6, 7, 15, 17, 18, 15584, 22, 566, 686, 2]
2026-07-23 10:11:24 +00:00
2026-07-25 08:10:48 +00:00
// Module 15583 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import apply from "apply";
import initialize from "initialize";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
function fetchingKey(guildId, channelId) {
let str = channelId;
if (null == channelId) {
str = "guild";
}
return "" + guildId + ":" + str;
}
function getOrCreateGuild(guildId) {
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[guildId]) {
dependencyMap[guildId] = {};
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
return dependencyMap[guildId];
2026-07-20 16:05:17 +00:00
}
function handleWebhookCreateUpdate(webhook) {
webhook = webhook.webhook;
getOrCreateGuild(webhook.guildId)[webhook.id] = webhook;
}
let closure_8 = {};
let closure_9 = {};
2026-07-23 10:11:24 +00:00
let tmp2 = ((Store) => {
2026-07-20 16:05:17 +00:00
class WebhooksStore {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_2(this, WebhooksStore);
obj = outer1_5(WebhooksStore);
tmp2 = outer1_4;
if (outer1_10()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_5;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_5(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(WebhooksStore, Store);
let obj = {
key: "isFetching",
value(arg0, arg1) {
2026-07-23 10:11:24 +00:00
return null != outer1_9[outer1_11(undefined, arg0, arg1)];
2026-07-20 16:05:17 +00:00
}
};
const items = [obj, , , ];
obj = {
key: "getWebhooksForGuild",
value(arg0) {
2026-07-23 10:11:24 +00:00
return WebhooksStore(outer1_1[6]).values(outer1_12(arg0));
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "getWebhooksForChannel",
value(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
const tmp = WebhooksStore(outer1_1[6]);
const values = WebhooksStore(outer1_1[6])(outer1_12(arg0)).values();
const tmpResult = WebhooksStore(outer1_1[6])(outer1_12(arg0));
return values.filter((channel_id) => channel_id.channel_id === closure_0).value();
2026-07-20 16:05:17 +00:00
}
};
items[2] = obj;
items[3] = {
key: "error",
get() {
2026-07-23 10:11:24 +00:00
return outer1_7;
2026-07-20 16:05:17 +00:00
}
};
return callback(WebhooksStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").Store);
2026-07-20 16:05:17 +00:00
tmp2.displayName = "WebhooksStore";
2026-07-23 10:11:24 +00:00
tmp2 = new tmp2(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
WEBHOOKS_UPDATE: function handleWebhooksUpdate(arg0) {
let channelId;
let error;
let guildId;
let webhooks;
({ guildId, channelId } = arg0);
({ webhooks, error } = arg0);
2026-07-23 10:11:24 +00:00
let obj;
2026-07-20 16:05:17 +00:00
if (null != webhooks) {
2026-07-23 10:11:24 +00:00
let c7 = null;
2026-07-20 16:05:17 +00:00
let items = [];
if (null != channelId) {
2026-07-23 10:11:24 +00:00
const tmp14 = channelId(obj[6]);
const values = channelId(obj[6])(getOrCreateGuild(guildId)).values();
const tmp14Result = channelId(obj[6])(getOrCreateGuild(guildId));
2026-07-20 16:05:17 +00:00
items = values.filter((channel_id) => channel_id.channel_id !== channelId).value();
const iter = values.filter((channel_id) => channel_id.channel_id !== channelId);
}
2026-07-23 10:11:24 +00:00
obj = {};
dependencyMap[guildId] = obj;
2026-07-20 16:05:17 +00:00
const combined = items.concat(webhooks);
const item = combined.forEach((id) => {
obj[id.id] = id;
return id;
});
fetchingKey(guildId, channelId);
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
} else if (null != error) {
2026-07-23 10:11:24 +00:00
c7 = error;
2026-07-20 16:05:17 +00:00
fetchingKey(guildId, channelId);
2026-07-23 10:11:24 +00:00
delete tmp3[tmp];
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let tmp4 = null != channelId;
if (tmp4) {
tmp4 = null != dependencyMap[guildId];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (tmp4) {
c7 = null;
obj = channelId(obj[5]);
2026-07-20 16:05:17 +00:00
const forChannel = obj.fetchForChannel(guildId, channelId);
}
}
},
WEBHOOKS_FETCHING: function handleWebhooksFetching(guildId) {
closure_9[fetchingKey(guildId.guildId, guildId.channelId)] = true;
},
WEBHOOK_CREATE: handleWebhookCreateUpdate,
WEBHOOK_UPDATE: handleWebhookCreateUpdate,
WEBHOOK_DELETE: function handleWebhookDelete(guildId) {
getOrCreateGuild(guildId.guildId);
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
});
2026-07-23 10:11:24 +00:00
let result = require("_possibleConstructorReturn").fileFinishedImporting("stores/WebhooksStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp2;