-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from na2na-p/develop
1.2.0.0
- Loading branch information
Showing
15 changed files
with
217 additions
and
206 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# DiscordBot Token | ||
TOKEN="YOUR_TOKEN_HERE" | ||
|
||
# DiscordBot Owner | ||
BOT_MASTER_ID="Your Discord ID" | ||
|
||
# DiscordBot Prefix | ||
PREFIX="YOUR_BOT_PREFIX_HERE" | ||
|
||
# DeepL API Key | ||
DEEPL_API_KEY="YOUR_DEEPL_API_KEY_HERE" | ||
|
||
# Commands Install Target Server ID | ||
# e.g. 123456789012345678,123456789012345678,123456789012345678 | ||
SET_COMMANDS_TARGET_SERVERS="YOUR_SERVER_ID_HERE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
{ | ||
"files.eol": "\n", | ||
"cSpell.words": [ | ||
"discordjs" | ||
] | ||
"files.eol": "\n", | ||
"cSpell.words": ["discordjs", "divitation"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import _log from '@utils/log.js'; | ||
// eslint-disable-next-line require-jsdoc | ||
function log(msg: string): void { | ||
_log(`[Config]: ${msg}`); | ||
} | ||
|
||
type configType = { | ||
token: string; | ||
botMasterId: string; | ||
prefix: string; | ||
deeplApiKey: string; | ||
setCommandsTargetServers: string[]; | ||
} | ||
|
||
if (process.env['NODE_ENV'] !== 'container') { | ||
log('Running in direct deployment mode. .env file loaded.'); | ||
const dotenv = await import('dotenv'); | ||
dotenv.config(); | ||
} else { | ||
log('Running in container mode. using environment variables.'); | ||
}; | ||
|
||
export const config: configType = { | ||
token: (() => { | ||
if (process.env['TOKEN']) { | ||
return process.env['TOKEN']; | ||
} else { | ||
throw new Error('TOKEN is not defined.'); | ||
} | ||
})(), | ||
botMasterId: (() => { | ||
if (process.env['BOT_MASTER_ID']) { | ||
return process.env['BOT_MASTER_ID']; | ||
} else { | ||
throw new Error('BOT_MASTER_ID is not defined.'); | ||
} | ||
})(), | ||
prefix: (() => { | ||
if (process.env['PREFIX']) { | ||
return process.env['PREFIX']; | ||
} else { | ||
throw new Error('PREFIX is not defined.'); | ||
} | ||
})(), | ||
deeplApiKey: (() => { | ||
if (process.env['DEEPL_API_KEY']) { | ||
return process.env['DEEPL_API_KEY']; | ||
} else { | ||
throw new Error('DEEPL_API_KEY is not defined.'); | ||
} | ||
})(), | ||
setCommandsTargetServers: (() => { | ||
if (process.env['SET_COMMANDS_TARGET_SERVERS']) { | ||
return process.env['SET_COMMANDS_TARGET_SERVERS'].split(','); | ||
} else { | ||
return []; | ||
} | ||
})(), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.