Skip to content

Commit cf85506

Browse files
committed
Use dotenv to load .env when not ran from pipenv
1 parent 255f732 commit cf85506

File tree

3 files changed

+112
-28
lines changed

3 files changed

+112
-28
lines changed

Pipfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7+
black = "==19.3b0"
78

89
[packages]
910
colorama = ">=0.4.0"
@@ -17,6 +18,8 @@ dnspython = "~=1.16.0"
1718
parsedatetime = "==2.4"
1819
aiohttp = "<3.6.0,>=3.3.0"
1920
pylint = "*"
21+
python-dotenv = ">=0.10.3"
22+
pipenv = "==2018.11.26"
2023
"discord.py" = "==1.1.1"
2124

2225
[requires]

Pipfile.lock

Lines changed: 105 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
import os
44
import typing
55

6+
from dotenv import load_dotenv
67
import isodate
7-
88
from discord.ext.commands import BadArgument
99

1010
from core._color_data import ALL_COLORS
1111
from core.models import InvalidConfigError
1212
from core.time import UserFriendlyTime
1313

1414

15+
load_dotenv()
16+
17+
1518
class ConfigManager:
1619

1720
allowed_to_change_in_command = {

0 commit comments

Comments
 (0)