From 83ce5656369d2dc6a716988a98bfbb0129898c07 Mon Sep 17 00:00:00 2001 From: kdh8219 <65698239+kdh8219@users.noreply.github.com> Date: Thu, 27 Apr 2023 23:19:06 +0900 Subject: [PATCH] .env.example --- .env.example | 12 ++++++++++++ src/deploy.ts | 4 ++-- src/wrapper/firebase.ts | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..fc56a69 --- /dev/null +++ b/.env.example @@ -0,0 +1,12 @@ +# FIREBASE +# cert data to string +FIREBASE_CERT = "JSON.stringify(the_file)" + + +# DISCORD +# discord bot token +DISCORD_TOKEN = "" +# discord application client id +DISCORD_CLIENT_ID = "" +# guild id for deploy +DISCORD_TARGRT_GUILD_ID = "" \ No newline at end of file diff --git a/src/deploy.ts b/src/deploy.ts index 3ab2c36..1727c32 100755 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -18,8 +18,8 @@ const rest = new REST({ version: "10" }).setToken( // The put method is used to fully refresh all commands in the guild with the current set await rest.put( Routes.applicationGuildCommands( - process.env.discord_CLIENT_ID as string, - process.env.discord_GUILD_ID as string + process.env.DISCORD_CLIENT_ID as string, + process.env.DISCORD_TARGET_GUILD_ID as string ), { body: commands } ); diff --git a/src/wrapper/firebase.ts b/src/wrapper/firebase.ts index 9d1b43e..ec47401 100644 --- a/src/wrapper/firebase.ts +++ b/src/wrapper/firebase.ts @@ -4,7 +4,7 @@ import { config } from "dotenv"; config(); initializeApp({ - credential: cert(JSON.parse(process.env["firebase_cert"] as string)), + credential: cert(JSON.parse(process.env.FIREBASE_CERT as string)), }); const db = getFirestore();