We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1baad5d commit 93accd7Copy full SHA for 93accd7
worker.js
@@ -181,3 +181,18 @@ function apiUrl (methodName, params = null) {
181
}
182
return `https://api.telegram.org/bot${TOKEN}/${methodName}${query}`
183
184
+
185
+/*
186
+* https://stackoverflow.com/a/65672697
187
+*/
188
+async function urlExists(url) {
189
+ return new Promise((resolve, reject) => {
190
+ fetch(url, {
191
+ method: "HEAD"
192
+ }).then(response => {
193
+ resolve(response.status.toString()[0] === "2")
194
+ }).catch(error => {
195
+ reject(false)
196
+ })
197
198
+}
0 commit comments