aboutsummaryrefslogtreecommitdiff
path: root/174bg/discord-bot/utilities/getUrl.js
diff options
context:
space:
mode:
Diffstat (limited to '174bg/discord-bot/utilities/getUrl.js')
-rw-r--r--174bg/discord-bot/utilities/getUrl.js14
1 files changed, 0 insertions, 14 deletions
diff --git a/174bg/discord-bot/utilities/getUrl.js b/174bg/discord-bot/utilities/getUrl.js
deleted file mode 100644
index a6e22ef..0000000
--- a/174bg/discord-bot/utilities/getUrl.js
+++ /dev/null
@@ -1,14 +0,0 @@
-export default async (url) => {
- const response = await fetch(url);
-
- if (!response.ok) return null;
-
- // is it json?
- const contentType = response.headers.get("content-type");
- if (contentType && contentType.includes("application/json")) {
- return await response.json();
- }
-
- // fallback to text
- return await response.text();
-};