summaryrefslogtreecommitdiffstats
path: root/src/api/misskey/index.ts
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-10-17 16:54:53 +0200
committerVolpeon <git@volpeon.ink>2021-10-17 16:54:53 +0200
commit30b0adcacef48ac53aea13cbdc3288db0bd8d103 (patch)
tree402f4cc31a2fa4f0e746c81755b537b5f5137e4c /src/api/misskey/index.ts
downloadferalbot-30b0adcacef48ac53aea13cbdc3288db0bd8d103.tar.gz
feralbot-30b0adcacef48ac53aea13cbdc3288db0bd8d103.tar.bz2
feralbot-30b0adcacef48ac53aea13cbdc3288db0bd8d103.zip
Init
Diffstat (limited to 'src/api/misskey/index.ts')
-rw-r--r--src/api/misskey/index.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/api/misskey/index.ts b/src/api/misskey/index.ts
new file mode 100644
index 0000000..64bfe67
--- /dev/null
+++ b/src/api/misskey/index.ts
@@ -0,0 +1,26 @@
1/*
2import got from "got";
3import FormData from "form-data";
4import stream from "stream";
5import config from "../../config";
6
7export interface DriveFile {
8 id: string;
9}
10
11export const client = got.extend({
12 prefixUrl: config.misskey.instance,
13});
14
15export function upload(buf: Buffer, filename: string) {
16 const body = new FormData();
17 body.append("i", config.misskey.token);
18 body.append("file", buf, { filename });
19
20 return client.post("drive/files/create", { body }).json<DriveFile>();
21};
22
23export function createNote() {
24
25}
26*/