1
0
forked from keinBot/cuffeo

refactor: remove flumm-fetch dependency

This commit is contained in:
2025-03-19 11:47:26 +01:00
parent ca114f677e
commit 2d13c865af
5 changed files with 39 additions and 18 deletions

View File

@@ -2,7 +2,6 @@ import https from "node:https";
import net from "node:net";
import url from "node:url";
import EventEmitter from "node:events";
import fetch from "flumm-fetch";
interface SlackOptions {
token: string;

View File

@@ -1,4 +1,3 @@
import fetch from "flumm-fetch";
import EventEmitter from "events";
const allowedFiles = ["audio", "video", "photo", "document"] as const;
@@ -227,7 +226,13 @@ export default class tg extends EventEmitter {
if(reply)
body["reply_to_message_id"] = reply;
const opts = { method: "POST", body };
const opts = {
method: "POST",
body: JSON.stringify(body),
headers: {
"Content-Type": "application/json"
}
};
return await (await fetch(`${this.api}/sendMessage`, opts)).json();
}