-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.ts
34 lines (33 loc) · 933 Bytes
/
variables.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
import process from "process";
import { config } from "dotenv";
const LogLevels = ["Warn", "Debug", "None"];
config();
export const Variables = {
get allowedChats() {
const envVal = process.env.HANNELORE_ALLOWED_CHATS ?? "";
return envVal.split(",").map(Number);
},
get logLevel() {
const level = process.env.HANNELORE_LOGLEVEL ?? "Warn";
if (!LogLevels.includes(level)) return "Warn";
return level as "Warn" | "Debug" | "None";
},
get faunaKey() {
return process.env.HANNELORE_FAUNA_KEY;
},
get telegramBotToken() {
return process.env.HANNELORE_TELEGRAM_BOT_TOKEN;
},
get giphyApiKey() {
return process.env.HANNELORE_GIPHY_API_KEY;
},
get nextcloudHost() {
return process.env.HANNELORE_NEXTCLOUD_URL;
},
get nextCloudUser() {
return process.env.HANNELORE_NEXTCLOUD_USER;
},
get nextCloudPassword() {
return process.env.HANNELORE_NEXTCLOUD_PASSWORD;
},
};