mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 09:50:07 +00:00
I have no idea what I am going
This commit is contained in:
@@ -55,12 +55,17 @@ export async function createShard(
|
||||
|
||||
// TODO: do something about this
|
||||
// TODO(ayntee): check if the readyState of the websocket is OPEN (not sure if this is the solution)
|
||||
if (!resuming) {
|
||||
// Intial identify with the gateway
|
||||
await identify(basicShard, identifyPayload);
|
||||
} else {
|
||||
await resume(basicShard, identifyPayload);
|
||||
}
|
||||
socket.onopen = async () => {
|
||||
if (!resuming) {
|
||||
// Intial identify with the gateway
|
||||
await identify(basicShard, identifyPayload);
|
||||
} else {
|
||||
await resume(basicShard, identifyPayload);
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: handle the WebSocket#error event
|
||||
socket.onerror = () => {};
|
||||
|
||||
socket.onmessage = ({ data: message }) => {
|
||||
if (message instanceof Uint8Array) {
|
||||
|
||||
13
test.ts
Normal file
13
test.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { startBot } from "./mod.ts";
|
||||
import { Intents } from "./src/types/options.ts";
|
||||
|
||||
const token = "NzcxMDU2NzQzNTI1Nzc3NDM4.X5mkjQ.KhrhSnfw4fs1VfgRdg0cLxRrDkA";
|
||||
|
||||
await startBot({
|
||||
intents: [Intents.GUILDS, Intents.GUILD_MESSAGES],
|
||||
token,
|
||||
eventHandlers: {
|
||||
ready: () => console.log("hello :)"),
|
||||
debug: console.log,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user