forked from keinBot/cuffeo
refactor: remove flumm-fetch dependency
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user