aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2018-03-06 02:33:57 +0100
committerGravatar Leon Sandøy <[email protected]>2018-03-06 02:33:57 +0100
commit997c7499da70839459d5d43f93d75f7eb4373b9a (patch)
tree1a9783b920ae0c41ecf67d260469fec748a34063
parentcleaning up constants.py for readability and because I need dynamic API URLs ... (diff)
gotta use http for local api requests. Also removed snekrc.
-rw-r--r--.snekrc6
-rw-r--r--bot/constants.py5
2 files changed, 3 insertions, 8 deletions
diff --git a/.snekrc b/.snekrc
deleted file mode 100644
index 9f582f477..000000000
--- a/.snekrc
+++ /dev/null
@@ -1,6 +0,0 @@
-[all]
-linters = flake8, safety, dodgy
-
-[flake8]
-max-line-length=120
-application_import_names=bot
diff --git a/bot/constants.py b/bot/constants.py
index 00b3fcb6c..c73069632 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -28,8 +28,9 @@ CLICKUP_TEAM = 754996
DEPLOY_URL = os.environ.get("DEPLOY_URL")
STATUS_URL = os.environ.get("STATUS_URL")
SITE_URL = os.environ.get("SERVER_NAME", "pythondiscord.local:8080")
-SITE_API_USER_URL = f"https://api.{SITE_URL}/user"
-SITE_API_TAGS_URL = f"https://api.{SITE_URL}/tags"
+SITE_PROTOCOL = 'http' if 'local' in SITE_URL else 'https'
+SITE_API_USER_URL = f"{SITE_PROTOCOL}://api.{SITE_URL}/user"
+SITE_API_TAGS_URL = f"{SITE_PROTOCOL}://api.{SITE_URL}/tags"
GITHUB_URL_BOT = "https://github.com/discord-python/bot"
BOT_AVATAR_URL = "https://raw.githubusercontent.com/discord-python/branding/master/logos/logo_circle.png"