Add print when status code isn't 200
This commit is contained in:
4
main.py
4
main.py
@@ -39,7 +39,9 @@ async def get_latest_post(subreddit):
|
|||||||
return post["title"], post["url"]
|
return post["title"], post["url"]
|
||||||
except (KeyError, json.JSONDecodeError):
|
except (KeyError, json.JSONDecodeError):
|
||||||
return None, None
|
return None, None
|
||||||
return None, None
|
else:
|
||||||
|
print(f"Failed to fetch Reddit data (maybe a block?): {response.status_code}")
|
||||||
|
return None, None
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
async def setChannel(message):
|
async def setChannel(message):
|
||||||
|
|||||||
Reference in New Issue
Block a user