diff options
author | 2019-10-22 22:05:50 +0200 | |
---|---|---|
committer | 2019-10-22 22:05:50 +0200 | |
commit | 5ec4db0cba484f8adfc25b642a4f24f362a5b53c (patch) | |
tree | 4365078396ced7fd037bbe104a0dd11387e2563c | |
parent | Merge branch 'master' of https://github.com/python-discord/bot into reddit-ap... (diff) |
Add reddit environment variable, change User-Agent and fix lint problem
-rw-r--r-- | bot/cogs/reddit.py | 4 | ||||
-rw-r--r-- | docker-compose.yml | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/bot/cogs/reddit.py b/bot/cogs/reddit.py index 7b183221c..76da0f09f 100644 --- a/bot/cogs/reddit.py +++ b/bot/cogs/reddit.py @@ -25,7 +25,7 @@ class Reddit(Cog): # including the target platform, a unique application identifier, a version string, # and your username as contact information, in the following format: # <platform>:<app ID>:<version string> (by /u/<reddit username>) - USER_AGENT = "docker:Discord Bot of https://pythondiscord.com/:v?.?.? (by /u/PythonDiscord)" + USER_AGENT = "docker-python3:Discord Bot of PythonDiscord (https://pythondiscord.com/):v?.?.? (by /u/PythonDiscord)" URL = "https://www.reddit.com" OAUTH_URL = "https://oauth.reddit.com" MAX_FETCH_RETRIES = 3 @@ -117,7 +117,7 @@ class Reddit(Cog): content = await response.json() posts = content["data"]["children"] return posts[:amount] - + await asyncio.sleep(3) log.debug(f"Invalid response from: {url} - status code {response.status}, mimetype {response.content_type}") diff --git a/docker-compose.yml b/docker-compose.yml index f79fdba58..7281c7953 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,3 +42,5 @@ services: environment: BOT_TOKEN: ${BOT_TOKEN} BOT_API_KEY: badbot13m0n8f570f942013fc818f234916ca531 + REDDIT_CLIENT_ID: ${REDDIT_CLIENT_ID} + REDDIT_SECRET: ${REDDIT_SECRET} |