mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 01:40:08 +00:00
fix cache
This commit is contained in:
@@ -41,7 +41,6 @@ export const createShard = async (
|
||||
botGatewayData: DiscordBotGatewayData,
|
||||
identifyPayload: object,
|
||||
) => {
|
||||
console.log("inside create shard");
|
||||
const shardSocket = await connectWebSocket(botGatewayData.url);
|
||||
let resumeInterval = 0;
|
||||
|
||||
@@ -101,7 +100,6 @@ postMessage({ type: "REQUEST_CLIENT_OPTIONS" });
|
||||
// @ts-ignore
|
||||
onmessage = (message) => {
|
||||
if (message.data.type === "CREATE_SHARD") {
|
||||
console.log("shard need to make shard");
|
||||
createShard(
|
||||
message.data.botGatewayData,
|
||||
message.data.identifyPayload,
|
||||
|
||||
@@ -58,14 +58,10 @@ import { createMessage } from "../structures/message.ts";
|
||||
let shardCounter = 0;
|
||||
|
||||
function createShardWorker() {
|
||||
// console.log("shard creating url", import.meta.url);
|
||||
const path = new URL("./shard.ts", import.meta.url).toString();
|
||||
// console.log("shard creating path", path);
|
||||
const shard = new Worker(path, { type: "module", deno: true });
|
||||
// console.log("shard made on manager");
|
||||
shard.onmessage = (message) => {
|
||||
if (message.data.type === "REQUEST_CLIENT_OPTIONS") {
|
||||
// console.log("sending client options");
|
||||
identifyPayload.shard = [shardCounter++, botGatewayData.shards];
|
||||
shard.postMessage(
|
||||
{
|
||||
@@ -75,7 +71,6 @@ function createShardWorker() {
|
||||
},
|
||||
);
|
||||
} else if (message.data.type === "HANDLE_DISCORD_PAYLOAD") {
|
||||
// console.log("manager payload");
|
||||
handleDiscordPayload(JSON.parse(message.data.payload));
|
||||
}
|
||||
};
|
||||
@@ -316,7 +311,6 @@ function handleDiscordPayload(data: DiscordPayload) {
|
||||
const message = createMessage(options);
|
||||
cache.messages.set(options.id, message);
|
||||
if (options.member && options.guild_id) {
|
||||
console.log("message create member", options);
|
||||
const guild = cache.guilds.get(options.guild_id);
|
||||
guild?.members.set(
|
||||
options.author.id,
|
||||
|
||||
Reference in New Issue
Block a user