Adds initial progress
This commit is contained in:
commit
a0b668cb90
34 changed files with 2680 additions and 0 deletions
34
source/Environment.ts
Normal file
34
source/Environment.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import dotenv from "dotenv";
|
||||
import path from "node:path";
|
||||
|
||||
type DiscordEnvironment = {
|
||||
token: string;
|
||||
guildId: string;
|
||||
clientId: string;
|
||||
}
|
||||
|
||||
export type DatabaseEnvironment = {
|
||||
path: string;
|
||||
}
|
||||
|
||||
export class Environment {
|
||||
get discord(): DiscordEnvironment {
|
||||
return {
|
||||
token: process.env.DISCORD_API_KEY ?? '',
|
||||
guildId: process.env.DISCORD_GUILD_ID ?? '',
|
||||
clientId: process.env.DISCORD_CLIENT_ID ?? '',
|
||||
}
|
||||
}
|
||||
|
||||
get database(): DatabaseEnvironment {
|
||||
return {
|
||||
path: path.resolve(process.env.DB_PATH ?? ''),
|
||||
}
|
||||
}
|
||||
|
||||
public setup() {
|
||||
dotenv.config({
|
||||
path: path.resolve(__dirname, "../environment/.env"),
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue