add sendShardMessage

This commit is contained in:
ITOH
2021-04-16 19:14:48 +02:00
parent 864945f578
commit 6315ba75fc
3 changed files with 23 additions and 5 deletions
+2 -2
View File
@@ -1,6 +1,7 @@
import { eventHandlers } from "../../bot.ts";
import { DiscordGatewayOpcodes } from "../../types/codes/gateway_opcodes.ts";
import type { StatusUpdate } from "../../types/gateway/status_update.ts";
import { sendShardMessage } from "../../ws/send_shard_message.ts";
import { ws } from "../../ws/ws.ts";
export function editBotStatus(data: Omit<StatusUpdate, "afk" | "since">) {
@@ -10,7 +11,7 @@ export function editBotStatus(data: Omit<StatusUpdate, "afk" | "since">) {
`Running forEach loop in editBotStatus function.`,
);
shard.queue.push({
sendShardMessage(shard, {
op: DiscordGatewayOpcodes.StatusUpdate,
d: {
since: null,
@@ -18,6 +19,5 @@ export function editBotStatus(data: Omit<StatusUpdate, "afk" | "since">) {
...data,
},
});
ws.processQueue(shard.id);
});
}