mirror of
https://github.com/JustusPlays78/DiscordBot.git
synced 2025-04-29 14:49:03 +00:00
Delete text.js
This commit is contained in:
parent
39af92d64d
commit
3e7b09c194
16
text.js
16
text.js
@ -1,16 +0,0 @@
|
|||||||
import fetch from "node-fetch";
|
|
||||||
|
|
||||||
|
|
||||||
export async function fetchText(url){
|
|
||||||
try {
|
|
||||||
const response = await fetch(url);
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`HTTP-Fehler! Status: ${response.status}`);
|
|
||||||
}
|
|
||||||
const text = await response.text();
|
|
||||||
return text; // Den Text zurückgeben
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Fehler beim Abrufen der Datei:', error);
|
|
||||||
throw error; // Fehler weiterwerfen
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user