summaryrefslogtreecommitdiff
path: root/src/teawie_bot/apis/guzzle.py
diff options
context:
space:
mode:
authorseth <[email protected]>2023-02-04 23:12:58 -0500
committerseth <[email protected]>2023-03-14 20:40:13 -0400
commit52e58d2da91d2980823612d6c55e41ed6af0382e (patch)
tree41cedd7715dca1e15e51fbba0351f2d69dd54dd4 /src/teawie_bot/apis/guzzle.py
parentd7c0dd5ac7ce11ca24f4d05c35820182957fa075 (diff)
feat: bit of a refactor
- moved teawie_bot to root directory - added nix flake
Diffstat (limited to 'src/teawie_bot/apis/guzzle.py')
-rw-r--r--src/teawie_bot/apis/guzzle.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/teawie_bot/apis/guzzle.py b/src/teawie_bot/apis/guzzle.py
deleted file mode 100644
index 7599606..0000000
--- a/src/teawie_bot/apis/guzzle.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import requests
-
-GUZZLE: str = "https://guzzle.gay/api"
-
-
-def get_random_teawie() -> str:
- resp: requests.Response
- try:
- resp = requests.get(GUZZLE + "/get_random_teawie", timeout=30)
- except (requests.RequestException, requests.ConnectionError,
- requests.HTTPError, requests.JSONDecodeError):
- return "something went wrong :("
- if not resp.status_code == 200:
- return "api request failed :("
-
- try:
- ret = resp.json()["url"]
- except KeyError:
- return "couldn't get url from api response :("
- return ret