diff options
Diffstat (limited to 'src/api/misskey/index.ts')
-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 | */ | ||