mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-31 16:00:07 +00:00
22 lines
588 B
TypeScript
22 lines
588 B
TypeScript
import Client from "./module/Client.ts"
|
|
import { configs } from "./configs.ts"
|
|
import { StatusType, GatewayOpcode } from "./types/discord.ts";
|
|
|
|
(async function () {
|
|
const client = new Client({
|
|
token: configs.token
|
|
});
|
|
|
|
const { gateway, connection } = await client.bootstrap();
|
|
|
|
for await (const message of connection) {
|
|
if (message.data?.op === GatewayOpcode.Hello) {
|
|
await message.action;
|
|
await gateway.updateStatus({
|
|
afk: false,
|
|
status: StatusType.DoNotDisturb
|
|
})
|
|
}
|
|
}
|
|
})();
|