Files
discordeno/testss/mod.ts
Skillz4Killz 5a4fef855e Proxy delete channel tests (#2174)
* feat: delete channel tests

* fix: use new tests in ci

* Update testss/deps.ts

Co-authored-by: LTS20050703 <87189679+lts20050703@users.noreply.github.com>

Co-authored-by: LTS20050703 <87189679+lts20050703@users.noreply.github.com>
2022-05-08 09:57:06 -04:00

27 lines
674 B
TypeScript

import { createBot, createRestManager, runMethod } from "../mod.ts";
import enableCachePlugin from "../plugins/cache/mod.ts";
import { dotenv } from "./deps.ts";
dotenv({ export: true, path: `${Deno.cwd()}/.env` });
export function loadBot() {
const token = Deno.env.get("DISCORD_TOKEN");
if (!token) throw new Error("Token was not provided.");
const botId = BigInt(atob(token.split(".")[0]));
const bot = enableCachePlugin(createBot({
events: {},
intents: [],
botId,
token,
}));
bot.rest = createRestManager({
token,
customUrl: Deno.env.get("PROXY_REST_URL"),
secretKey: Deno.env.get("PROXY_REST_SECRET"),
});
return bot;
}