/
mod.ts
72 lines (59 loc) · 1.76 KB
/
mod.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
let _envPermissionGranted = false;
{
const status = await Deno.permissions.request({ name: "env" });
if (status.state === "denied") {
console.warn("Failed to request env permission, IPC transport!");
}
_envPermissionGranted = status.state === "granted";
}
/*
TODO: Rework this
if (envPermissionGranted) {
const { XDG_RUNTIME_DIR, TMPDIR, TMP, TEMP } = Deno.env.toObject();
const requiredPath = XDG_RUNTIME_DIR ?? TMPDIR ?? TMP ?? TEMP ?? `/tmp`;
{
const status = await Deno.permissions.request({
name: "read",
path: requiredPath,
});
if (status.state === "denied") {
console.warn(
`Failed to request read permission for '${requiredPath}', IPC transport will not work!`
);
}
}
{
const status = await Deno.permissions.request({
name: "write",
path: requiredPath,
});
if (status.state === "denied") {
console.warn(
`Failed to request write permission for '${requiredPath}', IPC transport will not work!`
);
}
}
}
*/
{
const status = await Deno.permissions.request({
name: "net",
host: "discord.com",
});
if (status.state === "denied") {
console.warn(
"Failed to request net permission for 'discord.com', OAuth will not work!",
);
}
}
export * from "./src/Client.ts";
export * from "./src/structures/ClientUser.ts";
export * from "./src/structures/CertifiedDevice.ts";
export * from "./src/structures/Channel.ts";
export * from "./src/structures/Guild.ts";
export * from "./src/structures/Lobby.ts";
export * from "./src/structures/User.ts";
export * from "./src/structures/VoiceSettings.ts";
export * from "./src/structures/Transport.ts";
export * from "./src/structures/Message.ts";
export { type FormatFunction } from "./src/transport/IPC.ts";