gramstax 0.5.21 → 0.6.0
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/src/index.cjs +6 -6
- package/dist/src/index.d.cts +197 -238
- package/dist/src/index.d.ts +197 -238
- package/dist/src/index.js +6 -6
- package/package.json +1 -1
package/dist/src/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LoggingPretty } from 'logging-pretty';
|
|
1
|
+
import LoggingPretty$1, { LoggingPretty } from 'logging-pretty';
|
|
2
2
|
import { Keyv } from 'keyv';
|
|
3
3
|
import * as grammy from 'grammy';
|
|
4
4
|
import { Context, Keyboard, InlineKeyboard, Bot, BotError } from 'grammy';
|
|
@@ -55,7 +55,8 @@ type IMediaBlock = {
|
|
|
55
55
|
};
|
|
56
56
|
declare class TemplateEngine {
|
|
57
57
|
static _escape(str: string): string;
|
|
58
|
-
static
|
|
58
|
+
static _processScopeVariables(template: string): string;
|
|
59
|
+
static _processScopeExec(template: string): string;
|
|
59
60
|
static _processBaseBlocks(template: string): {
|
|
60
61
|
[baseId: string]: string;
|
|
61
62
|
};
|
|
@@ -63,7 +64,6 @@ declare class TemplateEngine {
|
|
|
63
64
|
static _processSpaceBlocks(template: string): string;
|
|
64
65
|
static _processDivBlocks(template: string): string;
|
|
65
66
|
static _processSwitchBlocks(template: string): string;
|
|
66
|
-
static _processExec(template: string): string;
|
|
67
67
|
static _processMapBlocks(template: string): string;
|
|
68
68
|
static _processMediaBlocks(template: string): {
|
|
69
69
|
[lang: string]: IMediaBlock;
|
|
@@ -83,24 +83,24 @@ declare class TemplateEngine {
|
|
|
83
83
|
};
|
|
84
84
|
};
|
|
85
85
|
static _compileToFunction<T extends boolean>(template: T extends true ? string[] : string, isArray: T): T extends true ? (data?: Record<string, any>) => string[] : (data?: Record<string, any>) => string;
|
|
86
|
-
static
|
|
86
|
+
static compileBlockMedia(template: string, baseBlocks?: ReturnType<typeof TemplateEngine._processBaseBlocks>): {
|
|
87
87
|
[baseId: string]: {
|
|
88
88
|
[lang: string]: (data?: Record<string, any>) => IMediaBlock;
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
|
-
static
|
|
91
|
+
static compileBlockMessage(template: string, baseBlocks?: ReturnType<typeof TemplateEngine._processBaseBlocks>): {
|
|
92
92
|
[baseId: string]: {
|
|
93
93
|
[lang: string]: (data?: Record<string, any>) => string;
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
|
-
static
|
|
96
|
+
static compileBlockDescription(template: string, baseBlocks?: ReturnType<typeof TemplateEngine._processBaseBlocks>): {
|
|
97
97
|
[baseId: string]: {
|
|
98
98
|
[scope: string]: {
|
|
99
99
|
[lang: string]: (data?: Record<string, any>) => string;
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
102
|
};
|
|
103
|
-
static
|
|
103
|
+
static compileBlockKeyboards(template: string, baseBlocks?: ReturnType<typeof TemplateEngine._processBaseBlocks>): {
|
|
104
104
|
[baseId: string]: {
|
|
105
105
|
[lang: string]: {
|
|
106
106
|
inline?: (data?: Record<string, any>) => string[];
|
|
@@ -124,10 +124,10 @@ declare class TemplateEngine {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
type ICompiledTemplate = {
|
|
127
|
-
media: ReturnType<typeof TemplateEngine.
|
|
128
|
-
message: ReturnType<typeof TemplateEngine.
|
|
129
|
-
keyboard: ReturnType<typeof TemplateEngine.
|
|
130
|
-
description: ReturnType<typeof TemplateEngine.
|
|
127
|
+
media: ReturnType<typeof TemplateEngine.compileBlockMedia>;
|
|
128
|
+
message: ReturnType<typeof TemplateEngine.compileBlockMessage>;
|
|
129
|
+
keyboard: ReturnType<typeof TemplateEngine.compileBlockKeyboards>;
|
|
130
|
+
description: ReturnType<typeof TemplateEngine.compileBlockDescription>;
|
|
131
131
|
};
|
|
132
132
|
type ITemplateOptions = {
|
|
133
133
|
path: string[];
|
|
@@ -169,29 +169,45 @@ declare class TemplateManager {
|
|
|
169
169
|
destroy(): Promise<void>;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
type
|
|
173
|
-
type
|
|
174
|
-
type
|
|
175
|
-
type
|
|
176
|
-
type
|
|
177
|
-
type
|
|
178
|
-
type
|
|
179
|
-
type
|
|
180
|
-
type
|
|
181
|
-
type
|
|
182
|
-
type
|
|
183
|
-
type
|
|
184
|
-
type
|
|
185
|
-
type
|
|
186
|
-
type
|
|
187
|
-
type
|
|
188
|
-
type
|
|
189
|
-
type
|
|
190
|
-
|
|
191
|
-
type
|
|
192
|
-
type
|
|
193
|
-
|
|
194
|
-
|
|
172
|
+
type ITInlineKb = InlineKeyboard;
|
|
173
|
+
type ITBottomKb = Keyboard;
|
|
174
|
+
type ITInBoKb = ITBottomKb | ITInlineKb;
|
|
175
|
+
type ITCt = Context;
|
|
176
|
+
type ITOptReply = Parameters<Context[`reply`]>[1];
|
|
177
|
+
type ITOptReplyPhoto = Parameters<Context[`replyWithPhoto`]>[1];
|
|
178
|
+
type ITOptReplyVideo = Parameters<Context[`replyWithVideo`]>[1];
|
|
179
|
+
type ITOptReplyAudio = Parameters<Context[`replyWithAudio`]>[1];
|
|
180
|
+
type ITOptReplyDocument = Parameters<Context[`replyWithDocument`]>[1];
|
|
181
|
+
type ITOptReplyAnimation = Parameters<Context[`replyWithAnimation`]>[1];
|
|
182
|
+
type ITOptReplyVoice = Parameters<Context[`replyWithVoice`]>[1];
|
|
183
|
+
type ITOptReplyVideoNote = Parameters<Context[`replyWithVideoNote`]>[1];
|
|
184
|
+
type ITOptReplySticker = Parameters<Context[`replyWithSticker`]>[1];
|
|
185
|
+
type ITOptReplyLocation = Parameters<Context[`replyWithLocation`]>[2];
|
|
186
|
+
type ITOptReplyContact = Parameters<Context[`replyWithContact`]>[2];
|
|
187
|
+
type ITOptEdit = Parameters<Context[`editMessageText`]>[1];
|
|
188
|
+
type ITOptEditMedia1 = Parameters<Context[`editMessageMedia`]>[0];
|
|
189
|
+
type ITOptEditMedia2 = Parameters<Context[`editMessageMedia`]>[1];
|
|
190
|
+
type ITReplyAction = Parameters<Context[`replyWithChatAction`]>[0];
|
|
191
|
+
type ITData = Record<string, any>;
|
|
192
|
+
type ITBottomKbParams = {
|
|
193
|
+
baseId?: string;
|
|
194
|
+
data?: ITData;
|
|
195
|
+
cache?: boolean;
|
|
196
|
+
};
|
|
197
|
+
type ITInlineKbParams = {
|
|
198
|
+
baseId?: string;
|
|
199
|
+
data?: ITData;
|
|
200
|
+
cache?: boolean;
|
|
201
|
+
};
|
|
202
|
+
type ITBuildDataOptions<C extends (...args: any[]) => any = any> = {
|
|
203
|
+
name?: string;
|
|
204
|
+
callback?: C;
|
|
205
|
+
intentText?: string;
|
|
206
|
+
intentTextCommand?: string;
|
|
207
|
+
};
|
|
208
|
+
type ITKbDest = typeof Ctx | Ctx | string;
|
|
209
|
+
type ITKbCols = `${1 | 2 | 3 | 4 | 5 | 6}` | `${1 | 2 | 3 | 4 | 5 | 6}-${1 | 2 | 3 | 4 | 5 | 6}`;
|
|
210
|
+
type ITPageData<T extends any[] = any[]> = {
|
|
195
211
|
name: string;
|
|
196
212
|
callback: (...payloads: T) => string;
|
|
197
213
|
intentText: string;
|
|
@@ -199,18 +215,24 @@ type IPageData<T extends any[] = any[]> = {
|
|
|
199
215
|
_positionPayloadText: number;
|
|
200
216
|
intentCallback: string;
|
|
201
217
|
};
|
|
202
|
-
type
|
|
218
|
+
type ITTemp = {
|
|
203
219
|
isAnswer: boolean;
|
|
204
220
|
session: Partial<ICacheRpc>;
|
|
205
|
-
data: Partial<
|
|
221
|
+
data: Partial<ITPageData<any>>;
|
|
206
222
|
[key: string]: any;
|
|
207
223
|
};
|
|
208
|
-
type
|
|
209
|
-
|
|
224
|
+
type ITCtxParams = {
|
|
225
|
+
ct: ITCt;
|
|
226
|
+
cacheSession: CacheExternal;
|
|
227
|
+
cacheKeyboard: Map<any, any>;
|
|
228
|
+
templateManager: TemplateManager;
|
|
229
|
+
temp: ITTemp;
|
|
230
|
+
};
|
|
231
|
+
|
|
210
232
|
declare class Ctx {
|
|
211
233
|
static template?: string;
|
|
212
|
-
static data:
|
|
213
|
-
data:
|
|
234
|
+
static data: ITPageData<any>;
|
|
235
|
+
data: ITPageData<any>;
|
|
214
236
|
get userIsPremium(): boolean;
|
|
215
237
|
get userIsBot(): boolean;
|
|
216
238
|
get userId(): number;
|
|
@@ -245,83 +267,59 @@ declare class Ctx {
|
|
|
245
267
|
get callbackData(): string;
|
|
246
268
|
get callbackDataPayloads(): string[];
|
|
247
269
|
get callbackDataPayload(): string;
|
|
248
|
-
get session():
|
|
249
|
-
set session(v:
|
|
250
|
-
ct:
|
|
270
|
+
get session(): ITTemp[`session`];
|
|
271
|
+
set session(v: ITTemp[`session`]);
|
|
272
|
+
ct: ITCt;
|
|
251
273
|
cacheSession: CacheExternal<ICacheRpc>;
|
|
252
274
|
cacheKeyboard: Map<any, any>;
|
|
253
275
|
templateManager: TemplateManager;
|
|
254
|
-
temp:
|
|
255
|
-
constructor(params:
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
replyVideoNote(keyboard?: IInBoKb, data?: IData, baseId?: string, options?: IOptReplyVideoNote): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
273
|
-
replySticker(keyboard?: IInBoKb, data?: IData, baseId?: string, options?: IOptReplySticker): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
274
|
-
replyLocation(keyboard?: IInBoKb, data?: IData, baseId?: string, options?: IOptReplyLocation): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
275
|
-
replyContact(keyboard?: IInBoKb, data?: IData, baseId?: string, options?: IOptReplyContact): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
276
|
-
replyAction(type: ITypeReplyAction): Promise<true>;
|
|
277
|
-
edit(keyboardInline?: IInlineKb, data?: IData, baseId?: string, options?: IOptEdit, fallbackReply?: boolean): Promise<true | (grammy_types.Update.Edited & grammy_types.Message.CommonMessage & {
|
|
276
|
+
temp: ITTemp;
|
|
277
|
+
constructor(params: ITCtxParams);
|
|
278
|
+
broadcast(ids: number[], languageCode: string[], keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReply, throwError?: boolean): Promise<void>;
|
|
279
|
+
broadcastMedia(ids: number[], languageCode: string[], keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplyPhoto | ITOptReplyVideo | ITOptReplyAudio | ITOptReplyDocument | ITOptReplyAnimation | ITOptReplyVoice | ITOptReplyVideoNote | ITOptReplySticker | ITOptReplyLocation | ITOptReplyContact, throwError?: boolean): Promise<void>;
|
|
280
|
+
reply(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReply): Promise<grammy_types.Message.TextMessage>;
|
|
281
|
+
replyMedia<T extends IMediaBlock[`type`]>(type: T, keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: T extends `photo` ? ITOptReplyPhoto : T extends `video` ? ITOptReplyVideo : T extends `audio` ? ITOptReplyAudio : T extends `document` ? ITOptReplyDocument : T extends `animation` ? ITOptReplyAnimation : T extends `voice` ? ITOptReplyVoice : T extends `video_note` ? ITOptReplyVideoNote : T extends `sticker` ? ITOptReplySticker : T extends `location` ? ITOptReplyLocation : T extends `contact` ? ITOptReplyContact : undefined): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
282
|
+
replyPhoto(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplyPhoto): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
283
|
+
replyVideo(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplyVideo): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
284
|
+
replyAudio(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplyAudio): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
285
|
+
replyDocument(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplyDocument): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
286
|
+
replyAnimation(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplyAnimation): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
287
|
+
replyVoice(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplyVoice): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
288
|
+
replyVideoNote(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplyVideoNote): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
289
|
+
replySticker(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplySticker): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
290
|
+
replyLocation(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplyLocation): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
291
|
+
replyContact(keyboard?: ITInBoKb, data?: ITData, baseId?: string, options?: ITOptReplyContact): Promise<grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | undefined>;
|
|
292
|
+
replyAction(type: ITReplyAction): Promise<true>;
|
|
293
|
+
edit(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options?: ITOptEdit, fallbackReply?: boolean): Promise<true | (grammy_types.Update.Edited & grammy_types.Message.CommonMessage & {
|
|
278
294
|
text: string;
|
|
279
295
|
} & Partial<{
|
|
280
296
|
entities: grammy_types.MessageEntity[];
|
|
281
297
|
}>) | undefined>;
|
|
282
|
-
editMedia<T extends IMediaBlock[`type`]>(type: T, keyboardInline?:
|
|
283
|
-
editPhoto(keyboardInline?:
|
|
284
|
-
editVideo(keyboardInline?:
|
|
285
|
-
editAudio(keyboardInline?:
|
|
286
|
-
editDocument(keyboardInline?:
|
|
287
|
-
editAnimation(keyboardInline?:
|
|
288
|
-
editVoice(keyboardInline?:
|
|
289
|
-
editVideoNote(keyboardInline?:
|
|
290
|
-
editSticker(keyboardInline?:
|
|
291
|
-
editLocation(keyboardInline?:
|
|
292
|
-
editContact(keyboardInline?:
|
|
298
|
+
editMedia<T extends IMediaBlock[`type`]>(type: T, keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options1?: T extends `voice` ? ITOptReplyVoice : T extends `video_note` ? ITOptReplyVideoNote : T extends `sticker` ? ITOptReplySticker : T extends `location` ? ITOptReplyLocation : T extends `contact` ? ITOptReplyContact : ITOptEditMedia1, options2?: ITOptEditMedia2, fallbackReply?: boolean): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
299
|
+
editPhoto(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options1?: ITOptEditMedia1, options2?: ITOptEditMedia2): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
300
|
+
editVideo(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options1?: ITOptEditMedia1, options2?: ITOptEditMedia2): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
301
|
+
editAudio(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options1?: ITOptEditMedia1, options2?: ITOptEditMedia2): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
302
|
+
editDocument(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options1?: ITOptEditMedia1, options2?: ITOptEditMedia2): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
303
|
+
editAnimation(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options1?: ITOptEditMedia1, options2?: ITOptEditMedia2): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
304
|
+
editVoice(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options?: ITOptEditMedia2): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
305
|
+
editVideoNote(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options?: ITOptEditMedia2): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
306
|
+
editSticker(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options?: ITOptEditMedia2): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
307
|
+
editLocation(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options?: ITOptEditMedia2): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
308
|
+
editContact(keyboardInline?: ITInlineKb, data?: ITData, baseId?: string, options?: ITOptEditMedia2): Promise<true | grammy_types.Message.LocationMessage | grammy_types.Message.ContactMessage | grammy_types.Message.PhotoMessage | grammy_types.Message.VideoMessage | grammy_types.Message.AudioMessage | grammy_types.Message.DocumentMessage | grammy_types.Message.VoiceMessage | grammy_types.Message.VideoNoteMessage | grammy_types.Message.StickerMessage | (grammy_types.Update.Edited & grammy_types.Message) | undefined>;
|
|
293
309
|
delete(): Promise<true>;
|
|
294
310
|
callbackQueryAnswer(options?: Parameters<typeof Ctx.prototype.ct.answerCallbackQuery>[0]): Promise<true | null>;
|
|
295
311
|
sessionSet(method: string, params: any, moreRoot?: Record<any, any>): Promise<boolean | null>;
|
|
296
312
|
sessionGet(): Promise<ICacheRpc | null>;
|
|
297
313
|
sessionClear(): Promise<boolean | null>;
|
|
298
|
-
static buildData<C extends (...args: any[]) => any>(callback: C):
|
|
299
|
-
static buildData<C extends (...args: any[]) => any>(options:
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
callback?: any;
|
|
308
|
-
intentText?: string;
|
|
309
|
-
intentTextCommand?: string;
|
|
310
|
-
}): IPageData<[]>;
|
|
311
|
-
static buildData(): IPageData<[]>;
|
|
312
|
-
keyboardCols<T = any>(k: T, a: string[], layout: IKbCols, cb: (e: string, i: number) => any): T;
|
|
313
|
-
bottomKeyboardT(layout?: IKbCols, baseId?: string | null, data?: Record<any, any>): Keyboard;
|
|
314
|
-
inlineKeyboardT(PageDest: IKbDest[], layout?: IKbCols, baseId?: string | null, data?: Record<any, any>): InlineKeyboard;
|
|
315
|
-
inlineKeyboard(callback: (k: IInlineKb, a: string[]) => IInlineKb, params?: {
|
|
316
|
-
baseId?: string;
|
|
317
|
-
data?: IData;
|
|
318
|
-
cache?: boolean;
|
|
319
|
-
}): IInlineKb;
|
|
320
|
-
bottomKeyboard(callback: (k: IBottomKb, a: string[]) => IBottomKb, params?: {
|
|
321
|
-
baseId?: string;
|
|
322
|
-
data?: IData;
|
|
323
|
-
cache?: boolean;
|
|
324
|
-
}): IBottomKb;
|
|
314
|
+
static buildData<C extends (...args: any[]) => any>(callback: C): ITPageData<Parameters<C>>;
|
|
315
|
+
static buildData<C extends (...args: any[]) => any>(options: ITBuildDataOptions): ITPageData<Parameters<C>>;
|
|
316
|
+
static buildData(options: ITBuildDataOptions): ITPageData<[]>;
|
|
317
|
+
static buildData(): ITPageData<[]>;
|
|
318
|
+
keyboardCols<T = any>(k: T, a: string[], layout: ITKbCols, cb: (e: string, i: number) => any): T;
|
|
319
|
+
bottomKeyboardT(layout?: ITKbCols, baseId?: string | null, data?: Record<any, any>): Keyboard;
|
|
320
|
+
inlineKeyboardT(PageDest: ITKbDest[], layout?: ITKbCols, baseId?: string | null, data?: ITData): InlineKeyboard;
|
|
321
|
+
inlineKeyboard(callback: (k: ITInlineKb, a: string[]) => ITInlineKb, params?: ITInlineKbParams): ITInlineKb;
|
|
322
|
+
bottomKeyboard(callback: (k: ITBottomKb, a: string[]) => ITBottomKb, params?: ITBottomKbParams): ITBottomKb;
|
|
325
323
|
getSeperatorTag(mtd?: `space` | `colon`): " " | ":";
|
|
326
324
|
havePayloads(str: string | undefined, mtd: Parameters<typeof this.getSeperatorTag>[0]): boolean;
|
|
327
325
|
addPayloads(str: string | undefined, mtd: Parameters<typeof this.getSeperatorTag>[0], pld: (string | undefined)[]): string;
|
|
@@ -370,47 +368,47 @@ declare class Ctx {
|
|
|
370
368
|
locationFree?(): Promise<any>;
|
|
371
369
|
contactFree?(): Promise<any>;
|
|
372
370
|
free?(): Promise<any>;
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
371
|
+
isSessionCallback(method?: string, name?: string): boolean;
|
|
372
|
+
isSessionCallbackPayload(method?: string, name?: string): boolean;
|
|
373
|
+
isSessionText(method?: string, name?: string): boolean;
|
|
374
|
+
isSessionTextPayload(method?: string, name?: string): boolean;
|
|
375
|
+
isSessionTextCommand(method?: string, name?: string): boolean;
|
|
376
|
+
isSessionTextCommandPayload(method?: string, name?: string): boolean;
|
|
377
|
+
isSessionTextFree(method?: string, name?: string): boolean;
|
|
378
|
+
isSessionPhotoCaption(method?: string, name?: string): boolean;
|
|
379
|
+
isSessionPhotoCaptionPayload(method?: string, name?: string): boolean;
|
|
380
|
+
isSessionPhotoCaptionCommand(method?: string, name?: string): boolean;
|
|
381
|
+
isSessionPhotoCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
382
|
+
isSessionPhotoFree(method?: string, name?: string): boolean;
|
|
383
|
+
isSessionVideoCaption(method?: string, name?: string): boolean;
|
|
384
|
+
isSessionVideoCaptionPayload(method?: string, name?: string): boolean;
|
|
385
|
+
isSessionVideoCaptionCommand(method?: string, name?: string): boolean;
|
|
386
|
+
isSessionVideoCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
387
|
+
isSessionVideoFree(method?: string, name?: string): boolean;
|
|
388
|
+
isSessionAudioCaption(method?: string, name?: string): boolean;
|
|
389
|
+
isSessionAudioCaptionPayload(method?: string, name?: string): boolean;
|
|
390
|
+
isSessionAudioCaptionCommand(method?: string, name?: string): boolean;
|
|
391
|
+
isSessionAudioCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
392
|
+
isSessionAudioFree(method?: string, name?: string): boolean;
|
|
393
|
+
isSessionDocumentCaption(method?: string, name?: string): boolean;
|
|
394
|
+
isSessionDocumentCaptionPayload(method?: string, name?: string): boolean;
|
|
395
|
+
isSessionDocumentCaptionCommand(method?: string, name?: string): boolean;
|
|
396
|
+
isSessionDocumentCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
397
|
+
isSessionDocumentFree(method?: string, name?: string): boolean;
|
|
398
|
+
isSessionAnimationCaption(method?: string, name?: string): boolean;
|
|
399
|
+
isSessionAnimationCaptionPayload(method?: string, name?: string): boolean;
|
|
400
|
+
isSessionAnimationCaptionCommand(method?: string, name?: string): boolean;
|
|
401
|
+
isSessionAnimationCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
402
|
+
isSessionAnimationFree(method?: string, name?: string): boolean;
|
|
403
|
+
isSessionVoiceCaption(method?: string, name?: string): boolean;
|
|
404
|
+
isSessionVoiceCaptionPayload(method?: string, name?: string): boolean;
|
|
405
|
+
isSessionVoiceCaptionCommand(method?: string, name?: string): boolean;
|
|
406
|
+
isSessionVoiceCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
407
|
+
isSessionVoiceFree(method?: string, name?: string): boolean;
|
|
408
|
+
isSessionVideoNoteFree(method?: string, name?: string): boolean;
|
|
409
|
+
isSessionStickerFree(method?: string, name?: string): boolean;
|
|
410
|
+
isSessionLocationFree(method?: string, name?: string): boolean;
|
|
411
|
+
isSessionContactFree(method?: string, name?: string): boolean;
|
|
414
412
|
sessionCallback(params?: any, name?: string): Promise<boolean | null>;
|
|
415
413
|
sessionCallbackPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
416
414
|
sessionText(params?: any, name?: string): Promise<boolean | null>;
|
|
@@ -452,47 +450,6 @@ declare class Ctx {
|
|
|
452
450
|
sessionStickerFree(params?: any, name?: string): Promise<boolean | null>;
|
|
453
451
|
sessionLocationFree(params?: any, name?: string): Promise<boolean | null>;
|
|
454
452
|
sessionContactFree(params?: any, name?: string): Promise<boolean | null>;
|
|
455
|
-
sessionToCallback(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
456
|
-
sessionToCallbackPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
457
|
-
sessionToText(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
458
|
-
sessionToTextPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
459
|
-
sessionToTextCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
460
|
-
sessionToTextCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
461
|
-
sessionToTextFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
462
|
-
sessionToPhotoCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
463
|
-
sessionToPhotoCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
464
|
-
sessionToPhotoCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
465
|
-
sessionToPhotoCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
466
|
-
sessionToPhotoFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
467
|
-
sessionToVideoCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
468
|
-
sessionToVideoCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
469
|
-
sessionToVideoCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
470
|
-
sessionToVideoCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
471
|
-
sessionToVideoFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
472
|
-
sessionToAudioCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
473
|
-
sessionToAudioCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
474
|
-
sessionToAudioCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
475
|
-
sessionToAudioCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
476
|
-
sessionToAudioFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
477
|
-
sessionToDocumentCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
478
|
-
sessionToDocumentCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
479
|
-
sessionToDocumentCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
480
|
-
sessionToDocumentCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
481
|
-
sessionToDocumentFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
482
|
-
sessionToAnimationCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
483
|
-
sessionToAnimationCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
484
|
-
sessionToAnimationCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
485
|
-
sessionToAnimationCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
486
|
-
sessionToAnimationFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
487
|
-
sessionToVoiceCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
488
|
-
sessionToVoiceCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
489
|
-
sessionToVoiceCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
490
|
-
sessionToVoiceCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
491
|
-
sessionToVoiceFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
492
|
-
sessionToVideoNoteFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
493
|
-
sessionToStickerFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
494
|
-
sessionToLocationFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
495
|
-
sessionToContactFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
496
453
|
methodSession(prefix: string, name: string | undefined): string;
|
|
497
454
|
methodSessionCallback(name?: string): string;
|
|
498
455
|
methodSessionCallbackPayload(name?: string): string;
|
|
@@ -537,41 +494,43 @@ declare class Ctx {
|
|
|
537
494
|
methodSessionContactFree(name?: string): string;
|
|
538
495
|
}
|
|
539
496
|
|
|
497
|
+
type ITGramstaxParams = {
|
|
498
|
+
token: string;
|
|
499
|
+
deploy: string;
|
|
500
|
+
log?: LoggingPretty$1 | boolean | null;
|
|
501
|
+
cacheSession?: CacheExternal;
|
|
502
|
+
cacheKeyboard?: Map<any, any>;
|
|
503
|
+
templateManager?: TemplateManager;
|
|
504
|
+
optionsPage?: {
|
|
505
|
+
shortCallbackData?: boolean;
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
|
|
540
509
|
declare class Gramstax<ICtx extends Ctx = Ctx> {
|
|
541
510
|
templateManager: TemplateManager;
|
|
542
511
|
cacheKeyboard: Map<any, any>;
|
|
543
512
|
cacheSession: CacheExternal<ICacheRpc>;
|
|
544
|
-
pages: ReturnType<typeof this.
|
|
513
|
+
pages: ReturnType<typeof this._pageLoads>;
|
|
545
514
|
optionsPage: {
|
|
546
515
|
shortCallbackData: boolean;
|
|
547
516
|
};
|
|
548
517
|
log: LoggingPretty | undefined;
|
|
549
518
|
bot: Bot;
|
|
550
519
|
handlerBotUpdate: any;
|
|
551
|
-
constructor(params:
|
|
552
|
-
|
|
553
|
-
deploy: string;
|
|
554
|
-
log?: LoggingPretty | boolean | null;
|
|
555
|
-
cacheSession?: CacheExternal;
|
|
556
|
-
cacheKeyboard?: Map<any, any>;
|
|
557
|
-
templateManager?: TemplateManager;
|
|
558
|
-
optionsPage?: {
|
|
559
|
-
shortCallbackData?: boolean;
|
|
560
|
-
};
|
|
561
|
-
});
|
|
562
|
-
onCatch(error: BotError<Context>): void;
|
|
520
|
+
constructor(params: ITGramstaxParams);
|
|
521
|
+
_onCatch(error: BotError<Context>): void;
|
|
563
522
|
hookBeforeStart(): void;
|
|
564
523
|
hookAfterStart(): void;
|
|
565
|
-
|
|
524
|
+
_onStart(botInfo: UserFromGetMe, method: `polling` | `webhook` | `serverless`, data: string | null): Promise<void>;
|
|
566
525
|
createBot(token: string): Bot<Context, grammy.Api<grammy.RawApi>>;
|
|
567
526
|
createCtx(ct: Context): ICtx;
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
527
|
+
_runPolling(): void;
|
|
528
|
+
_runWebhook(fullUrl: string): Promise<void>;
|
|
529
|
+
_runServerless(adapter: string): Promise<void>;
|
|
530
|
+
_pageBuildData(Page: typeof Ctx, filePath: string): void;
|
|
531
|
+
_pageSorts(Page: typeof Ctx, pages: typeof Gramstax.prototype.pages, indexPage: number): void;
|
|
573
532
|
executeSyncBlocksDescription(pages: typeof Gramstax.prototype.pages): Promise<void>;
|
|
574
|
-
|
|
533
|
+
_pageLoads(): {
|
|
575
534
|
all: Record<string, typeof Ctx>;
|
|
576
535
|
routeDynamic: string[];
|
|
577
536
|
routeDynamicSpesific: {
|
|
@@ -621,11 +580,11 @@ declare class Gramstax<ICtx extends Ctx = Ctx> {
|
|
|
621
580
|
}[];
|
|
622
581
|
};
|
|
623
582
|
routeStatic: {
|
|
624
|
-
|
|
583
|
+
text: Record<string, {
|
|
625
584
|
name: string;
|
|
626
585
|
routeName: string;
|
|
627
586
|
}>;
|
|
628
|
-
|
|
587
|
+
callback: Record<string, {
|
|
629
588
|
name: string;
|
|
630
589
|
routeName: string;
|
|
631
590
|
}>;
|
|
@@ -745,11 +704,11 @@ declare class Gramstax<ICtx extends Ctx = Ctx> {
|
|
|
745
704
|
}>;
|
|
746
705
|
};
|
|
747
706
|
routeStaticSession: {
|
|
748
|
-
|
|
707
|
+
text: Record<string, {
|
|
749
708
|
name: string;
|
|
750
709
|
routeName: string;
|
|
751
710
|
}>;
|
|
752
|
-
|
|
711
|
+
callback: Record<string, {
|
|
753
712
|
name: string;
|
|
754
713
|
routeName: string;
|
|
755
714
|
}>;
|
|
@@ -917,35 +876,35 @@ declare class Gramstax<ICtx extends Ctx = Ctx> {
|
|
|
917
876
|
lenListRouteStaticIntent: 15;
|
|
918
877
|
lenListRouteStaticSession: 41;
|
|
919
878
|
};
|
|
920
|
-
|
|
879
|
+
_pageRoutes(ctx: ICtx, fromListener: `callback` | keyof typeof Gramstax.prototype.pages.routeDynamicSpesific): Promise<any>;
|
|
921
880
|
hookBeforeRoute(ctx: ICtx, listenerName: string): Promise<boolean>;
|
|
922
881
|
hookErrorPage(ctx: ICtx, listenerName: string, error: any, isEdit: boolean): Promise<void>;
|
|
923
882
|
hookErrorInputNotFoundPage(ctx: ICtx): Promise<void>;
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
883
|
+
_onMessage(ct: Context, listenerName: keyof typeof Gramstax.prototype.pages.routeDynamicSpesific): Promise<void>;
|
|
884
|
+
_onCallbackQueryData(ct: Context): Promise<void>;
|
|
885
|
+
_onMessageText(ct: Context): Promise<void>;
|
|
886
|
+
_onMessagePhoto(ct: Context): Promise<void>;
|
|
887
|
+
_onMessageVideo(ct: Context): Promise<void>;
|
|
888
|
+
_onMessageAudio(ct: Context): Promise<void>;
|
|
889
|
+
_onMessageDocument(ct: Context): Promise<void>;
|
|
890
|
+
_onMessageAnimation(ct: Context): Promise<void>;
|
|
891
|
+
_onMessageVoice(ct: Context): Promise<void>;
|
|
892
|
+
_onMessageVideoNote(ct: Context): Promise<void>;
|
|
893
|
+
_onMessageSticker(ct: Context): Promise<void>;
|
|
894
|
+
_onMessageLocation(ct: Context): Promise<void>;
|
|
895
|
+
_onMessageContact(ct: Context): Promise<void>;
|
|
896
|
+
_registerOnCallbackQueryData(): void;
|
|
897
|
+
_registerOnMessageText(): void;
|
|
898
|
+
_registerOnMessagePhoto(): void;
|
|
899
|
+
_registerOnMessageVideo(): void;
|
|
900
|
+
_registerOnMessageAudio(): void;
|
|
901
|
+
_registerOnMessageDocument(): void;
|
|
902
|
+
_registerOnMessageAnimation(): void;
|
|
903
|
+
_registerOnMessageVoice(): void;
|
|
904
|
+
_registerOnMessageVideoNote(): void;
|
|
905
|
+
_registerOnMessageSticker(): void;
|
|
906
|
+
_registerOnMessageLocation(): void;
|
|
907
|
+
_registerOnMessageContact(): void;
|
|
949
908
|
}
|
|
950
909
|
|
|
951
910
|
declare class LabelKeyboard {
|
|
@@ -1068,4 +1027,4 @@ declare class WorkerThreadPool {
|
|
|
1068
1027
|
request(threadId: number, method: string, params: any, _wait?: boolean, _others?: any): Promise<any>;
|
|
1069
1028
|
}
|
|
1070
1029
|
|
|
1071
|
-
export { BlockKeyboard, CacheExternal, Ctx, Gramstax, type ICacheRpc, type IMapRpc, type IMediaBlock, LabelKeyboard, LoggingUtil, TemplateEngine, TemplateManager, type WorkerThreadAsyncMethods, WorkerThreadExport, type WorkerThreadExportOpt, WorkerThreadGatewayClient, type WorkerThreadGatewayProxy, WorkerThreadGatewayServer, WorkerThreadInit, WorkerThreadLaunch, WorkerThreadPool, WorkerThreadRpc, log };
|
|
1030
|
+
export { BlockKeyboard, CacheExternal, Ctx, Gramstax, type ICacheRpc, type IMapRpc, type IMediaBlock, type ITBottomKb, type ITBottomKbParams, type ITBuildDataOptions, type ITCt, type ITCtxParams, type ITData, type ITGramstaxParams, type ITInBoKb, type ITInlineKb, type ITInlineKbParams, type ITKbCols, type ITKbDest, type ITOptEdit, type ITOptEditMedia1, type ITOptEditMedia2, type ITOptReply, type ITOptReplyAnimation, type ITOptReplyAudio, type ITOptReplyContact, type ITOptReplyDocument, type ITOptReplyLocation, type ITOptReplyPhoto, type ITOptReplySticker, type ITOptReplyVideo, type ITOptReplyVideoNote, type ITOptReplyVoice, type ITPageData, type ITReplyAction, type ITTemp, LabelKeyboard, LoggingUtil, TemplateEngine, TemplateManager, type WorkerThreadAsyncMethods, WorkerThreadExport, type WorkerThreadExportOpt, WorkerThreadGatewayClient, type WorkerThreadGatewayProxy, WorkerThreadGatewayServer, WorkerThreadInit, WorkerThreadLaunch, WorkerThreadPool, WorkerThreadRpc, log };
|