-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ts
38 lines (36 loc) · 1.05 KB
/
config.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
import {Snowflake} from "discord-api-types/v10";
import * as fs from "fs";
import {ApplicationCommand} from "discord.js";
import {
APIApplicationCommandPermission
} from "discord-api-types/payloads/v10/_interactions/_applicationCommands/permissions";
type Config = {
token: string;
guildId: Snowflake;
suggestionsChannel: Snowflake;
discordWelcomesChannel: Snowflake;
welcomesChannel: Snowflake;
nitroChannel: Snowflake;
logChannel: Snowflake;
bugReportsChannel: Snowflake;
nitroBoostRole: Snowflake;
authorization: string;
reactionRoles: {
message: Snowflake;
reactions: Record<string, {
name: string;
role: Snowflake;
}>;
};
host: string;
suggestionsPermissions: APIApplicationCommandPermission;
};
export const getConfig = () => new Promise<Config>((resolve, reject) => {
fs.readFile("config.json", (error, data) => {
if (error) {
reject(error);
} else {
resolve(JSON.parse(data.toString()));
}
});
});