summaryrefslogtreecommitdiffstats
path: root/src/api/misskey
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/misskey')
-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*/