We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6de6f13 commit cd1004cCopy full SHA for cd1004c
src/gist/create.ts
@@ -0,0 +1,20 @@
1
+import request from '../structures/request';
2
+import { GistFile, GistOptions, GistResponse, ReqRet } from '../types';
3
+
4
+export default async (
5
+ files: GistFile,
6
+ description: string,
7
+ token: string,
8
+ options?: GistOptions
9
+): Promise<ReqRet<GistResponse>> =>
10
+ await request<GistResponse>('https://api.github.com/gists', token, 'POST', {
11
+ data: {
12
+ description: description,
13
+ files: {
14
+ ...files,
15
+ },
16
+ public: options?.secret ? true : false,
17
18
+ })
19
+ .then((response) => Promise.resolve(response))
20
+ .catch((err) => Promise.reject(err));
0 commit comments