mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
21 lines
701 B
TypeScript
21 lines
701 B
TypeScript
import { eventHandlers } from "../../bot.ts";
|
|
import { DiscordGatewayOpcodes } from "../../types/codes/gateway_opcodes.ts";
|
|
import type { StatusUpdate } from "../../types/gateway/status_update.ts";
|
|
import { snakelize } from "../../util/utils.ts";
|
|
import { ws } from "../../ws/ws.ts";
|
|
|
|
export function editBotStatus(data: Omit<StatusUpdate, "afk" | "since">) {
|
|
ws.shards.forEach((shard) => {
|
|
eventHandlers.debug?.("loop", `Running forEach loop in editBotStatus function.`);
|
|
|
|
ws.sendShardMessage(shard, {
|
|
op: DiscordGatewayOpcodes.StatusUpdate,
|
|
d: {
|
|
since: null,
|
|
afk: false,
|
|
...snakelize<Omit<StatusUpdate, "afk" | "since">>(data),
|
|
},
|
|
});
|
|
});
|
|
}
|