Skip to content

Commit e997f3e

Browse files
committed
fixed env vars
1 parent 2319f45 commit e997f3e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/services/load_env.util.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class AtBotEnv {
2626
/// If the file is not found, it will throw an exception.
2727
Future<void> _loadEnv() async {
2828
try {
29-
BotLogger.log(LogType.info, Platform.environment['prefix']);
30-
3129
/// Check if file exist in the current working directory.
3230
if (File(BotConstants.envFile).existsSync()) {
3331
/// Load the env variables from the file.
@@ -64,10 +62,10 @@ class AtBotEnv {
6462
}
6563
} on FileSystemException catch (_) {
6664
/// Throw an exception if the file is not found.
67-
throw FileSystemException(
68-
'File `${BotConstants.envFile}` not found.',
69-
Directory.current.path,
70-
);
65+
BotLogger.logln(LogType.error, 'Missing `.env` file');
66+
_prefix = Platform.environment['prefix'];
67+
_token = Platform.environment['token'];
68+
_clientID = Platform.environment['botID']!.toSnowflake();
7169
} catch (e) {
7270
throw Exception('Exception : $e');
7371
}

0 commit comments

Comments
 (0)