Files
discordeno/mod.ts
2020-02-10 21:15:44 +00:00

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
})
}
}
})();