Fix os.getenv and add more checks
This commit is contained in:
parent
1f13dffd54
commit
f9743f8a84
2 changed files with 5 additions and 3 deletions
|
|
@ -6,13 +6,16 @@ from enum import Enum
|
||||||
|
|
||||||
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
|
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
|
||||||
PB_TOKEN = os.getenv("PB_TOKEN")
|
PB_TOKEN = os.getenv("PB_TOKEN")
|
||||||
PB_URL = os.getenv("PB_TOKEN")
|
PB_URL = os.getenv("PB_URL")
|
||||||
PB_COLLECTION = os.getenv("PB_TOKEN")
|
PB_COLLECTION = os.getenv("PB_COLLECTION")
|
||||||
|
|
||||||
for env in [DISCORD_TOKEN, PB_TOKEN, PB_URL, PB_COLLECTION]:
|
for env in [DISCORD_TOKEN, PB_TOKEN, PB_URL, PB_COLLECTION]:
|
||||||
if env is None:
|
if env is None:
|
||||||
print("Missing env var")
|
print("Missing env var")
|
||||||
quit()
|
quit()
|
||||||
|
elif PB_URL is not None:
|
||||||
|
if PB_URL.startswith("https://"):
|
||||||
|
PB_URL = PB_URL.strip("https://")
|
||||||
|
|
||||||
|
|
||||||
class Events(Enum):
|
class Events(Enum):
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{ pkgs, lib, config, inputs, ... }:
|
{ pkgs, lib, config, inputs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
packages = [pkgs.openssl pkgs.cacert];
|
|
||||||
dotenv.enable = true;
|
dotenv.enable = true;
|
||||||
# https://devenv.sh/languages/
|
# https://devenv.sh/languages/
|
||||||
languages.python.enable = true;
|
languages.python.enable = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue