diff options
| author | 2021-03-09 20:37:19 +0100 | |
|---|---|---|
| committer | 2021-03-13 12:39:41 +0100 | |
| commit | bcddc5cdaaa021af3fef9b0b3c2b30d11960083a (patch) | |
| tree | 4b85f172d3640858bffe8085049afbe187a7dbfe | |
| parent | Branding: initiate repository abstraction (diff) | |
Branding: migrate constants
Constants will only be used in one place and there's not enough of them
to warrant a separate module.
| -rw-r--r-- | bot/exts/backend/branding/_constants.py | 11 | ||||
| -rw-r--r-- | bot/exts/backend/branding/_repository.py | 11 |
2 files changed, 11 insertions, 11 deletions
diff --git a/bot/exts/backend/branding/_constants.py b/bot/exts/backend/branding/_constants.py deleted file mode 100644 index 8afac6538..000000000 --- a/bot/exts/backend/branding/_constants.py +++ /dev/null @@ -1,11 +0,0 @@ -from bot.constants import Keys - -# Base URL for requests into the branding repository -BRANDING_URL = "https://api.github.com/repos/kwzrd/pydis-branding/contents" - -PARAMS = {"ref": "kwzrd/events-rework"} # Target branch -HEADERS = {"Accept": "application/vnd.github.v3+json"} # Ensure we use API v3 - -# A GitHub token is not necessary for the cog to operate, unauthorized requests are however limited to 60 per hour -if Keys.github: - HEADERS["Authorization"] = f"token {Keys.github}" diff --git a/bot/exts/backend/branding/_repository.py b/bot/exts/backend/branding/_repository.py index de47fcd36..3bdb632f8 100644 --- a/bot/exts/backend/branding/_repository.py +++ b/bot/exts/backend/branding/_repository.py @@ -1,6 +1,17 @@ import logging from bot.bot import Bot +from bot.constants import Keys + +# Base URL for requests into the branding repository +BRANDING_URL = "https://api.github.com/repos/kwzrd/pydis-branding/contents" + +PARAMS = {"ref": "kwzrd/events-rework"} # Target branch +HEADERS = {"Accept": "application/vnd.github.v3+json"} # Ensure we use API v3 + +# A GitHub token is not necessary for the cog to operate, unauthorized requests are however limited to 60 per hour +if Keys.github: + HEADERS["Authorization"] = f"token {Keys.github}" log = logging.getLogger(__name__) |