diff options
author | Volpeon <git@volpeon.ink> | 2021-10-17 16:54:53 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2021-10-17 16:54:53 +0200 |
commit | 30b0adcacef48ac53aea13cbdc3288db0bd8d103 (patch) | |
tree | 402f4cc31a2fa4f0e746c81755b537b5f5137e4c /src/api/misskey | |
download | feralbot-30b0adcacef48ac53aea13cbdc3288db0bd8d103.tar.gz feralbot-30b0adcacef48ac53aea13cbdc3288db0bd8d103.tar.bz2 feralbot-30b0adcacef48ac53aea13cbdc3288db0bd8d103.zip |
Init
Diffstat (limited to 'src/api/misskey')
-rw-r--r-- | src/api/misskey/index.ts | 26 |
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 | /* | ||
2 | import got from "got"; | ||
3 | import FormData from "form-data"; | ||
4 | import stream from "stream"; | ||
5 | import config from "../../config"; | ||
6 | |||
7 | export interface DriveFile { | ||
8 | id: string; | ||
9 | } | ||
10 | |||
11 | export const client = got.extend({ | ||
12 | prefixUrl: config.misskey.instance, | ||
13 | }); | ||
14 | |||
15 | export 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 | |||
23 | export function createNote() { | ||
24 | |||
25 | } | ||
26 | */ | ||