karboai 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core/karboai.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare class KarboAI {
|
|
|
20
20
|
messageId: string;
|
|
21
21
|
createdAt: number;
|
|
22
22
|
}>;
|
|
23
|
-
upload: (
|
|
23
|
+
upload: (buffer: Buffer, fileName?: string) => Promise<string>;
|
|
24
24
|
message: (chatId: string, messageId: string) => Promise<Message>;
|
|
25
25
|
members: (chatId: string, limit?: number, offset?: number) => Promise<MembersResponse>;
|
|
26
26
|
user: (userId: string) => Promise<User>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"karboai.d.ts","sourceRoot":"","sources":["../../src/core/karboai.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAqB,MAAM,oBAAoB,CAAC;AACpE,OAAO,EACL,eAAe,EAEf,UAAU,EAQX,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,OAAO,EAAiB,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,IAAI,EAAc,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;gBAE5B,MAAM,EAAE,WAAW;IAQ/B,IAAI,EAAE,WAEL;IAED,OAAO,CAAC,WAAW,CAcd;IAEE,EAAE,QAAa,OAAO,CAAC,UAAU,CAAC,CAIpC;IAEE,IAAI,GACT,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,iBAAiB,MAAM;;;OAMpB;IAEE,KAAK,GACV,QAAQ,MAAM,EACd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AAC,CAI9C;IAEE,KAAK,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC,CAOhD;IAEA,IAAI,GAAU,QAAQ,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC,CAO/D;IAEA,MAAM,GAAI,WAAU,eAAgC,KAAG,IAAI,CACZ;IAE/C,IAAI,GAAI,GAAG,SAAS,MAAM,EAAE,KAAG,IAAI,CACP;CACpC"}
|
package/dist/core/karboai.js
CHANGED
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.KarboAI = void 0;
|
|
7
|
-
const promises_1 = require("fs/promises");
|
|
8
7
|
const responses_1 = require("../schemas/responses");
|
|
9
8
|
const logger_1 = __importDefault(require("../utils/logger"));
|
|
10
9
|
const utils_1 = require("../utils/utils");
|
|
@@ -49,12 +48,11 @@ class KarboAI {
|
|
|
49
48
|
images,
|
|
50
49
|
replyMessageId,
|
|
51
50
|
});
|
|
52
|
-
upload = async (
|
|
53
|
-
const file = await (0, promises_1.readFile)(path);
|
|
51
|
+
upload = async (buffer, fileName = 'file.png') => {
|
|
54
52
|
return (await this.httptoolkit.multipart({
|
|
55
53
|
path: '/bot/upload/image',
|
|
56
|
-
buffer
|
|
57
|
-
fileName
|
|
54
|
+
buffer,
|
|
55
|
+
fileName,
|
|
58
56
|
schema: responses_1.UploadResponseSchema,
|
|
59
57
|
})).url;
|
|
60
58
|
};
|
|
@@ -24,7 +24,7 @@ export declare const MessageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
24
24
|
avatar_frame: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
|
|
25
25
|
role: z.ZodOptional<z.ZodNumber>;
|
|
26
26
|
app_role: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
panel_color: z.ZodOptional<z.ZodString
|
|
27
|
+
panel_color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
28
|
level: z.ZodOptional<z.ZodNumber>;
|
|
29
29
|
nickname_color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
30
|
nickname_emoji: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -35,7 +35,7 @@ export declare const MessageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
35
35
|
avatarFrame: Record<string, never> | null | undefined;
|
|
36
36
|
role: number | undefined;
|
|
37
37
|
appRole: number | undefined;
|
|
38
|
-
panelColor: string | undefined;
|
|
38
|
+
panelColor: string | null | undefined;
|
|
39
39
|
level: number | undefined;
|
|
40
40
|
nicknameColor: string | null | undefined;
|
|
41
41
|
nicknameEmoji: string | null | undefined;
|
|
@@ -46,7 +46,7 @@ export declare const MessageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
46
46
|
avatar_frame?: Record<string, never> | null | undefined;
|
|
47
47
|
role?: number | undefined;
|
|
48
48
|
app_role?: number | undefined;
|
|
49
|
-
panel_color?: string | undefined;
|
|
49
|
+
panel_color?: string | null | undefined;
|
|
50
50
|
level?: number | undefined;
|
|
51
51
|
nickname_color?: string | null | undefined;
|
|
52
52
|
nickname_emoji?: string | null | undefined;
|
|
@@ -68,7 +68,7 @@ export declare const MessageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
68
68
|
avatarFrame: Record<string, never> | null | undefined;
|
|
69
69
|
role: number | undefined;
|
|
70
70
|
appRole: number | undefined;
|
|
71
|
-
panelColor: string | undefined;
|
|
71
|
+
panelColor: string | null | undefined;
|
|
72
72
|
level: number | undefined;
|
|
73
73
|
nicknameColor: string | null | undefined;
|
|
74
74
|
nicknameEmoji: string | null | undefined;
|
|
@@ -88,7 +88,7 @@ export declare const MessageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
88
88
|
avatarFrame: Record<string, never> | null | undefined;
|
|
89
89
|
role: number | undefined;
|
|
90
90
|
appRole: number | undefined;
|
|
91
|
-
panelColor: string | undefined;
|
|
91
|
+
panelColor: string | null | undefined;
|
|
92
92
|
level: number | undefined;
|
|
93
93
|
nicknameColor: string | null | undefined;
|
|
94
94
|
nicknameEmoji: string | null | undefined;
|
|
@@ -43,7 +43,7 @@ export declare const AuthorSchema: z.ZodPipe<z.ZodObject<{
|
|
|
43
43
|
avatar_frame: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
|
|
44
44
|
role: z.ZodOptional<z.ZodNumber>;
|
|
45
45
|
app_role: z.ZodOptional<z.ZodNumber>;
|
|
46
|
-
panel_color: z.ZodOptional<z.ZodString
|
|
46
|
+
panel_color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
47
|
level: z.ZodOptional<z.ZodNumber>;
|
|
48
48
|
nickname_color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
49
|
nickname_emoji: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -54,7 +54,7 @@ export declare const AuthorSchema: z.ZodPipe<z.ZodObject<{
|
|
|
54
54
|
avatarFrame: Record<string, never> | null | undefined;
|
|
55
55
|
role: number | undefined;
|
|
56
56
|
appRole: number | undefined;
|
|
57
|
-
panelColor: string | undefined;
|
|
57
|
+
panelColor: string | null | undefined;
|
|
58
58
|
level: number | undefined;
|
|
59
59
|
nicknameColor: string | null | undefined;
|
|
60
60
|
nicknameEmoji: string | null | undefined;
|
|
@@ -65,7 +65,7 @@ export declare const AuthorSchema: z.ZodPipe<z.ZodObject<{
|
|
|
65
65
|
avatar_frame?: Record<string, never> | null | undefined;
|
|
66
66
|
role?: number | undefined;
|
|
67
67
|
app_role?: number | undefined;
|
|
68
|
-
panel_color?: string | undefined;
|
|
68
|
+
panel_color?: string | null | undefined;
|
|
69
69
|
level?: number | undefined;
|
|
70
70
|
nickname_color?: string | null | undefined;
|
|
71
71
|
nickname_emoji?: string | null | undefined;
|
|
@@ -34,7 +34,7 @@ exports.AuthorSchema = zod_1.z
|
|
|
34
34
|
avatar_frame: zod_1.z.object().nullable().optional(),
|
|
35
35
|
role: zod_1.z.number().optional(),
|
|
36
36
|
app_role: zod_1.z.number().optional(),
|
|
37
|
-
panel_color: zod_1.z.string().optional(),
|
|
37
|
+
panel_color: zod_1.z.string().nullable().optional(),
|
|
38
38
|
level: zod_1.z.number().optional(),
|
|
39
39
|
nickname_color: zod_1.z.string().nullable().optional(),
|
|
40
40
|
nickname_emoji: zod_1.z.string().nullable().optional(),
|