gramstax 0.0.1 → 0.0.3
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 +2 -0
- package/dist/src/index.cjs.map +1 -0
- package/dist/src/{core/bot.d.ts → index.d.cts} +501 -13
- package/dist/src/index.d.ts +1292 -5
- package/dist/src/index.js +2 -4
- package/dist/src/index.js.map +1 -0
- package/package.json +10 -9
- package/dist/package.json +0 -52
- package/dist/src/base/general.d.ts +0 -7
- package/dist/src/base/general.d.ts.map +0 -1
- package/dist/src/base/general.js +0 -15
- package/dist/src/base/guard.d.ts +0 -13
- package/dist/src/base/guard.d.ts.map +0 -1
- package/dist/src/base/guard.js +0 -8
- package/dist/src/base/index.d.ts +0 -4
- package/dist/src/base/index.d.ts.map +0 -1
- package/dist/src/base/index.js +0 -3
- package/dist/src/base/page.d.ts +0 -263
- package/dist/src/base/page.d.ts.map +0 -1
- package/dist/src/base/page.js +0 -805
- package/dist/src/cache/external.d.ts +0 -10
- package/dist/src/cache/external.d.ts.map +0 -1
- package/dist/src/cache/external.js +0 -16
- package/dist/src/cache/index.d.ts +0 -2
- package/dist/src/cache/index.d.ts.map +0 -1
- package/dist/src/cache/index.js +0 -1
- package/dist/src/core/bot.d.ts.map +0 -1
- package/dist/src/core/bot.js +0 -465
- package/dist/src/core/ctx.d.ts +0 -60
- package/dist/src/core/ctx.d.ts.map +0 -1
- package/dist/src/core/ctx.js +0 -175
- package/dist/src/core/index.d.ts +0 -3
- package/dist/src/core/index.d.ts.map +0 -1
- package/dist/src/core/index.js +0 -2
- package/dist/src/grammy/index.d.ts +0 -2
- package/dist/src/grammy/index.d.ts.map +0 -1
- package/dist/src/grammy/index.js +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/template/engine.d.ts +0 -34
- package/dist/src/template/engine.d.ts.map +0 -1
- package/dist/src/template/engine.js +0 -122
- package/dist/src/template/index.d.ts +0 -3
- package/dist/src/template/index.d.ts.map +0 -1
- package/dist/src/template/index.js +0 -2
- package/dist/src/template/manager.d.ts +0 -111
- package/dist/src/template/manager.d.ts.map +0 -1
- package/dist/src/template/manager.js +0 -237
- package/src/base/general.ts +0 -17
- package/src/base/guard.ts +0 -10
- package/src/base/index.ts +0 -3
- package/src/base/page.ts +0 -1111
- package/src/cache/external.ts +0 -15
- package/src/cache/index.ts +0 -1
- package/src/core/bot.ts +0 -535
- package/src/core/ctx.ts +0 -177
- package/src/core/index.ts +0 -2
- package/src/grammy/index.ts +0 -1
- package/src/index.ts +0 -4
- package/src/template/engine.ts +0 -167
- package/src/template/index.ts +0 -2
- package/src/template/manager.ts +0 -280
- package/src/types/page.d.ts +0 -4
|
@@ -1,14 +1,503 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import LoggingPretty, { LoggingPretty as LoggingPretty$1 } from 'logging-pretty';
|
|
2
|
+
import * as grammy_types from 'grammy/types';
|
|
3
|
+
import { UserFromGetMe } from 'grammy/types';
|
|
4
|
+
import { Keyv } from 'keyv';
|
|
5
|
+
import { FSWatcher } from 'chokidar';
|
|
6
|
+
import { Context, Keyboard, InlineKeyboard, Bot, BotError } from 'grammy';
|
|
7
|
+
|
|
8
|
+
declare abstract class BaseGeneral {
|
|
9
|
+
protected static log: LoggingPretty;
|
|
10
|
+
protected static logError(error: any, func: string): void;
|
|
11
|
+
protected logError(error: any, constructorName?: string, funcName?: string): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type IMore = Omit<Required<ConstructorParameters<typeof Keyv>>[0], `store` | `namespace` | `ttl`> & {
|
|
15
|
+
forceStore?: any;
|
|
16
|
+
};
|
|
17
|
+
declare class CacheExternal extends Keyv {
|
|
18
|
+
url: string | `memory`;
|
|
19
|
+
constructor(url?: string | `memory`, namespace?: string, ttl?: number, more?: IMore);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare class TemplateEngine {
|
|
23
|
+
static _escape(str: string): string;
|
|
24
|
+
static _processVariables(template: string): string;
|
|
25
|
+
static _processBaseBlocks(template: string): {
|
|
26
|
+
[baseId: string]: string;
|
|
27
|
+
};
|
|
28
|
+
static _processScriptBlocks(template: string): string;
|
|
29
|
+
static _processSpaceBlocks(template: string): string;
|
|
30
|
+
static _processDivBlocks(template: string): string;
|
|
31
|
+
static _processMessageBlocks(template: string): {
|
|
32
|
+
[lang: string]: string;
|
|
33
|
+
};
|
|
34
|
+
static _processKeyboardBlocks(template: string): {
|
|
35
|
+
[lang: string]: {
|
|
36
|
+
inline?: string;
|
|
37
|
+
default?: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
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;
|
|
41
|
+
static compileMessages(template: string): {
|
|
42
|
+
[baseId: string]: {
|
|
43
|
+
[lang: string]: (data?: Record<string, any>) => string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
static compileKeyboards(template: string): {
|
|
47
|
+
[baseId: string]: {
|
|
48
|
+
[lang: string]: {
|
|
49
|
+
inline?: (data?: Record<string, any>) => string[];
|
|
50
|
+
default?: (data?: Record<string, any>) => string[];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Template file interface for better type safety */
|
|
57
|
+
type ICompiledTemplate = {
|
|
58
|
+
message: ReturnType<typeof TemplateEngine.compileMessages>;
|
|
59
|
+
keyboard: ReturnType<typeof TemplateEngine.compileKeyboards>;
|
|
60
|
+
};
|
|
61
|
+
/** Template loading options */
|
|
62
|
+
type ITemplateOptions = {
|
|
63
|
+
/** Enable file watching for hot reloading (if have templatePath) */
|
|
64
|
+
enableWatch?: boolean;
|
|
65
|
+
/** Base path for template files (set null if dont want read template from file) */
|
|
66
|
+
path?: string | undefined | null;
|
|
67
|
+
/** Force language params to this value */
|
|
68
|
+
forceLanguage?: string | undefined | null;
|
|
69
|
+
};
|
|
70
|
+
/** Template management system */
|
|
71
|
+
declare class TemplateManager {
|
|
72
|
+
_map: Map<string, ICompiledTemplate>;
|
|
73
|
+
_engine: typeof TemplateEngine;
|
|
74
|
+
_watcher: FSWatcher | null;
|
|
75
|
+
_supportedExtensions: Set<string>;
|
|
76
|
+
readonly _path: string | null;
|
|
77
|
+
readonly _forceLanguage: string | null;
|
|
78
|
+
readonly _isWatchEnabled: boolean;
|
|
79
|
+
constructor(options?: ITemplateOptions);
|
|
80
|
+
/** Validate and ensure template directory exists. @returns Void */
|
|
81
|
+
_validatePath(): void;
|
|
82
|
+
/** Initialize file system watcher for hot reloading. @returns Void */
|
|
83
|
+
_initializeWatcher(): void;
|
|
84
|
+
/** Handle file change events */
|
|
85
|
+
_handleFileChange(filepath: string): Promise<void>;
|
|
86
|
+
/** Handle file add events */
|
|
87
|
+
_handleFileAdd(filePath: string): Promise<void>;
|
|
88
|
+
/** Handle file delete events */
|
|
89
|
+
_handleFileDelete(filePath: string): void;
|
|
90
|
+
/** Handle watcher errors */
|
|
91
|
+
_handleWatchError(error: any): void;
|
|
92
|
+
/** Load all Template files during initialization */
|
|
93
|
+
_loadAllFiles(): void;
|
|
94
|
+
/** Load and compile a single template file */
|
|
95
|
+
_loadFile(filename: string, useSync?: boolean): Promise<void>;
|
|
96
|
+
_isValidFile(filename: string): boolean;
|
|
97
|
+
_getKey(filename: string): string;
|
|
98
|
+
compile(key: string, rawTemplate: string, keepIfExist?: Partial<{
|
|
99
|
+
[K in keyof ICompiledTemplate]: boolean;
|
|
100
|
+
}>): void;
|
|
101
|
+
/**
|
|
102
|
+
* Get compiled message template
|
|
103
|
+
* @param key Template identifier (filename without extension)
|
|
104
|
+
* @param baseId Base id attr from block
|
|
105
|
+
* @param language Target language code
|
|
106
|
+
* @param data Template variables
|
|
107
|
+
* @returns Rendered message string
|
|
108
|
+
*/
|
|
109
|
+
getMessage(key: string, baseId?: string, language?: string, data?: Record<string, any>): string;
|
|
110
|
+
/**
|
|
111
|
+
* Get compiled keyboard template
|
|
112
|
+
* @param key Template identifier (filename without extension)
|
|
113
|
+
* @param baseId Base id attr from block
|
|
114
|
+
* @param language Target language code
|
|
115
|
+
* @param data Template variables
|
|
116
|
+
* @returns Array of rendered button labels
|
|
117
|
+
*/
|
|
118
|
+
getKeyboard(key: string, baseId?: string, language?: string, display?: `inline` | `default`, data?: Record<string, any>): string[];
|
|
119
|
+
/**
|
|
120
|
+
* Update message template in memory
|
|
121
|
+
* @param key Template identifier (filename without extension)
|
|
122
|
+
* @param rawTemplate Raw template string
|
|
123
|
+
*/
|
|
124
|
+
setMessage(key: string, rawTemplate: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Update keyboard template in memory
|
|
127
|
+
* @param key Template identifier (filename without extension)
|
|
128
|
+
* @param rawTemplate Raw template string
|
|
129
|
+
*/
|
|
130
|
+
setKeyboard(key: string, rawTemplate: string): void;
|
|
131
|
+
/**
|
|
132
|
+
* Write template to file and update cache
|
|
133
|
+
* @param filename Target filename (with extension)
|
|
134
|
+
* @param rawTemplate Template to write
|
|
135
|
+
* @returns Promise that resolves when file is written
|
|
136
|
+
*/
|
|
137
|
+
write(filename: string, rawTemplate: string): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Get list of available template
|
|
140
|
+
* @returns Array of template names
|
|
141
|
+
*/
|
|
142
|
+
getAvailable(): string[];
|
|
143
|
+
/**
|
|
144
|
+
* Check if template exists
|
|
145
|
+
* @param key Template identifier
|
|
146
|
+
* @returns True if template exists
|
|
147
|
+
*/
|
|
148
|
+
has(key: string): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Get cache statistics
|
|
151
|
+
* @returns Object with cache information
|
|
152
|
+
*/
|
|
153
|
+
getCacheStats(): {
|
|
154
|
+
templateCount: number;
|
|
155
|
+
totalSize: number;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Cleanup resources and close watchers
|
|
159
|
+
* @returns Promise void
|
|
160
|
+
*/
|
|
161
|
+
destroy(): Promise<void>;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
declare class Ctx extends BaseGeneral {
|
|
165
|
+
ct: Context;
|
|
166
|
+
templateManager: TemplateManager;
|
|
167
|
+
cacheSession: CacheExternal;
|
|
168
|
+
cacheKeyboard: Map<any, any>;
|
|
169
|
+
data: {
|
|
170
|
+
name: string;
|
|
171
|
+
callbackData: (...args: any) => string | any;
|
|
172
|
+
};
|
|
173
|
+
get isPremium(): boolean;
|
|
174
|
+
get isBot(): boolean;
|
|
175
|
+
get userid(): number;
|
|
176
|
+
get username(): string;
|
|
177
|
+
get fullname(): string;
|
|
178
|
+
get firstname(): string;
|
|
179
|
+
get lastname(): string;
|
|
180
|
+
get msgText(): string;
|
|
181
|
+
get msgTextIntent(): string;
|
|
182
|
+
get msgTextPayloads(): any[];
|
|
183
|
+
get msgTextPayload(): string;
|
|
184
|
+
get msgCaption(): string;
|
|
185
|
+
get msgCaptionIntent(): string;
|
|
186
|
+
get msgPhoto(): grammy_types.PhotoSize[] | undefined;
|
|
187
|
+
get msgVideo(): grammy_types.Video | undefined;
|
|
188
|
+
get msgAudio(): grammy_types.Audio | undefined;
|
|
189
|
+
get callbackData(): string;
|
|
190
|
+
get callbackDataIntent(): string;
|
|
191
|
+
get callbackDataPayloads(): any[];
|
|
192
|
+
get callbackDataPayload(): string;
|
|
193
|
+
get callbackDataParts(): any[];
|
|
194
|
+
get languageCode(): any;
|
|
195
|
+
set languageCode(v: any);
|
|
196
|
+
session: {
|
|
197
|
+
method?: string;
|
|
198
|
+
params?: any;
|
|
199
|
+
};
|
|
200
|
+
constructor(ct: Context, templateManager: TemplateManager, cacheSession: CacheExternal, cacheKeyboard: Map<any, any>);
|
|
201
|
+
broadcast(ids: any[], languageCode: any[], keyboard?: Keyboard | InlineKeyboard, data?: Record<string, any>, baseId?: string, options?: any): Promise<void>;
|
|
202
|
+
reply(keyboard?: Keyboard | InlineKeyboard, data?: Record<string, any>, baseId?: string, options?: any): Promise<grammy_types.Message.TextMessage>;
|
|
203
|
+
replyAction(type: Parameters<typeof this$1.ct.replyWithChatAction>[0]): Promise<true>;
|
|
204
|
+
edit(keyboard?: Keyboard | InlineKeyboard, data?: Record<string, any>, baseId?: string, options?: any): Promise<true | (grammy_types.Update.Edited & grammy_types.Message.CommonMessage & {
|
|
205
|
+
text: string;
|
|
206
|
+
} & Partial<{
|
|
207
|
+
entities: grammy_types.MessageEntity[];
|
|
208
|
+
}>) | undefined>;
|
|
209
|
+
delete(): Promise<true>;
|
|
210
|
+
callbackQueryAnswer(options?: any): Promise<true | null>;
|
|
211
|
+
sessionSet(method: string, params: any, ...moreRoot: any): Promise<boolean | null>;
|
|
212
|
+
sessionGet(): Promise<{
|
|
213
|
+
method: string;
|
|
214
|
+
params: any;
|
|
215
|
+
[moreRoot: string]: any;
|
|
216
|
+
} | null>;
|
|
217
|
+
sessionClear(): Promise<boolean | null>;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
declare abstract class BasePage extends Ctx {
|
|
221
|
+
static template?: string;
|
|
222
|
+
static data: {
|
|
223
|
+
name: string;
|
|
224
|
+
callbackData: (...args: any) => string | any;
|
|
225
|
+
};
|
|
226
|
+
transition?(...args: any): Promise<void>;
|
|
227
|
+
internal?(...args: any): Promise<void>;
|
|
228
|
+
notify?(...args: any): Promise<void>;
|
|
229
|
+
callback?(): Promise<void>;
|
|
230
|
+
callbackPayload?(): Promise<void>;
|
|
231
|
+
text?(): Promise<void>;
|
|
232
|
+
textPayload?(): Promise<void>;
|
|
233
|
+
textCommand?(): Promise<void>;
|
|
234
|
+
textCommandPayload?(): Promise<void>;
|
|
235
|
+
textFree?(): Promise<void>;
|
|
236
|
+
photoCaption?(): Promise<void>;
|
|
237
|
+
photoCaptionPayload?(): Promise<void>;
|
|
238
|
+
photoCaptionCommand?(): Promise<void>;
|
|
239
|
+
photoCaptionCommandPayload?(): Promise<void>;
|
|
240
|
+
photoFree?(): Promise<void>;
|
|
241
|
+
videoCaption?(): Promise<void>;
|
|
242
|
+
videoCaptionPayload?(): Promise<void>;
|
|
243
|
+
videoCaptionCommand?(): Promise<void>;
|
|
244
|
+
videoCaptionCommandPayload?(): Promise<void>;
|
|
245
|
+
videoFree?(): Promise<void>;
|
|
246
|
+
audioCaption?(): Promise<void>;
|
|
247
|
+
audioCaptionPayload?(): Promise<void>;
|
|
248
|
+
audioCaptionCommand?(): Promise<void>;
|
|
249
|
+
audioCaptionCommandPayload?(): Promise<void>;
|
|
250
|
+
audioFree?(): Promise<void>;
|
|
251
|
+
documentCaption?(): Promise<void>;
|
|
252
|
+
documentCaptionPayload?(): Promise<void>;
|
|
253
|
+
documentCaptionCommand?(): Promise<void>;
|
|
254
|
+
documentCaptionCommandPayload?(): Promise<void>;
|
|
255
|
+
documentFree?(): Promise<void>;
|
|
256
|
+
animationCaption?(): Promise<void>;
|
|
257
|
+
animationCaptionPayload?(): Promise<void>;
|
|
258
|
+
animationCaptionCommand?(): Promise<void>;
|
|
259
|
+
animationCaptionCommandPayload?(): Promise<void>;
|
|
260
|
+
animationFree?(): Promise<void>;
|
|
261
|
+
voiceCaption?(): Promise<void>;
|
|
262
|
+
voiceCaptionPayload?(): Promise<void>;
|
|
263
|
+
voiceCaptionCommand?(): Promise<void>;
|
|
264
|
+
voiceCaptionCommandPayload?(): Promise<void>;
|
|
265
|
+
voiceFree?(): Promise<void>;
|
|
266
|
+
videoNoteCaption?(): Promise<void>;
|
|
267
|
+
videoNoteCaptionPayload?(): Promise<void>;
|
|
268
|
+
videoNoteCaptionCommand?(): Promise<void>;
|
|
269
|
+
videoNoteCaptionCommandPayload?(): Promise<void>;
|
|
270
|
+
videoNoteFree?(): Promise<void>;
|
|
271
|
+
stickerFree?(): Promise<void>;
|
|
272
|
+
locationFree?(): Promise<void>;
|
|
273
|
+
contactFree?(): Promise<void>;
|
|
274
|
+
free?(): Promise<void>;
|
|
275
|
+
ctx: Ctx;
|
|
276
|
+
constructor(ctx: Ctx & {
|
|
277
|
+
ctx?: Ctx;
|
|
278
|
+
});
|
|
279
|
+
static buildData<C extends ((...args: any[]) => any) | undefined = undefined>(callback?: C): {
|
|
280
|
+
name: string;
|
|
281
|
+
callbackData: ((this: {
|
|
282
|
+
name: string;
|
|
283
|
+
}, ...args: Parameters<Exclude<C, undefined>>) => ReturnType<Exclude<C, undefined>>) | ((this: {
|
|
284
|
+
name: string;
|
|
285
|
+
}) => string);
|
|
286
|
+
};
|
|
287
|
+
buildInlineKeyboard(callback: (kb: InlineKeyboard, arr: any[]) => InlineKeyboard, params?: {
|
|
288
|
+
baseId?: any;
|
|
289
|
+
data?: Record<string, any>;
|
|
290
|
+
cache?: boolean;
|
|
291
|
+
}): InlineKeyboard;
|
|
292
|
+
buildKeyboard(callback: (kb: Keyboard, arr: any[]) => Keyboard, params?: {
|
|
293
|
+
baseId?: any;
|
|
294
|
+
data?: Record<string, any>;
|
|
295
|
+
cache?: boolean;
|
|
296
|
+
}): Keyboard;
|
|
297
|
+
validateSessionCallback(method?: string, name?: string): boolean;
|
|
298
|
+
validateSessionCallbackPayload(method?: string, name?: string): boolean;
|
|
299
|
+
validateSessionText(method?: string, name?: string): boolean;
|
|
300
|
+
validateSessionTextPayload(method?: string, name?: string): boolean;
|
|
301
|
+
validateSessionTextCommand(method?: string, name?: string): boolean;
|
|
302
|
+
validateSessionTextCommandPayload(method?: string, name?: string): boolean;
|
|
303
|
+
validateSessionTextFree(method?: string, name?: string): boolean;
|
|
304
|
+
validateSessionPhotoCaption(method?: string, name?: string): boolean;
|
|
305
|
+
validateSessionPhotoCaptionPayload(method?: string, name?: string): boolean;
|
|
306
|
+
validateSessionPhotoCaptionCommand(method?: string, name?: string): boolean;
|
|
307
|
+
validateSessionPhotoCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
308
|
+
validateSessionPhotoFree(method?: string, name?: string): boolean;
|
|
309
|
+
validateSessionVideoCaption(method?: string, name?: string): boolean;
|
|
310
|
+
validateSessionVideoCaptionPayload(method?: string, name?: string): boolean;
|
|
311
|
+
validateSessionVideoCaptionCommand(method?: string, name?: string): boolean;
|
|
312
|
+
validateSessionVideoCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
313
|
+
validateSessionVideoFree(method?: string, name?: string): boolean;
|
|
314
|
+
validateSessionAudioCaption(method?: string, name?: string): boolean;
|
|
315
|
+
validateSessionAudioCaptionPayload(method?: string, name?: string): boolean;
|
|
316
|
+
validateSessionAudioCaptionCommand(method?: string, name?: string): boolean;
|
|
317
|
+
validateSessionAudioCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
318
|
+
validateSessionAudioFree(method?: string, name?: string): boolean;
|
|
319
|
+
validateSessionDocumentCaption(method?: string, name?: string): boolean;
|
|
320
|
+
validateSessionDocumentCaptionPayload(method?: string, name?: string): boolean;
|
|
321
|
+
validateSessionDocumentCaptionCommand(method?: string, name?: string): boolean;
|
|
322
|
+
validateSessionDocumentCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
323
|
+
validateSessionDocumentFree(method?: string, name?: string): boolean;
|
|
324
|
+
validateSessionAnimationCaption(method?: string, name?: string): boolean;
|
|
325
|
+
validateSessionAnimationCaptionPayload(method?: string, name?: string): boolean;
|
|
326
|
+
validateSessionAnimationCaptionCommand(method?: string, name?: string): boolean;
|
|
327
|
+
validateSessionAnimationCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
328
|
+
validateSessionAnimationFree(method?: string, name?: string): boolean;
|
|
329
|
+
validateSessionVoiceCaption(method?: string, name?: string): boolean;
|
|
330
|
+
validateSessionVoiceCaptionPayload(method?: string, name?: string): boolean;
|
|
331
|
+
validateSessionVoiceCaptionCommand(method?: string, name?: string): boolean;
|
|
332
|
+
validateSessionVoiceCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
333
|
+
validateSessionVoiceFree(method?: string, name?: string): boolean;
|
|
334
|
+
validateSessionVideoNoteCaption(method?: string, name?: string): boolean;
|
|
335
|
+
validateSessionVideoNoteCaptionPayload(method?: string, name?: string): boolean;
|
|
336
|
+
validateSessionVideoNoteCaptionCommand(method?: string, name?: string): boolean;
|
|
337
|
+
validateSessionVideoNoteCaptionCommandPayload(method?: string, name?: string): boolean;
|
|
338
|
+
validateSessionVideoNoteFree(method?: string, name?: string): boolean;
|
|
339
|
+
validateSessionStickerFree(method?: string, name?: string): boolean;
|
|
340
|
+
validateSessionLocationFree(method?: string, name?: string): boolean;
|
|
341
|
+
validateSessionContactFree(method?: string, name?: string): boolean;
|
|
342
|
+
sessionCallback(params?: any, name?: string): Promise<boolean | null>;
|
|
343
|
+
sessionCallbackPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
344
|
+
sessionText(params?: any, name?: string): Promise<boolean | null>;
|
|
345
|
+
sessionTextPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
346
|
+
sessionTextCommand(params?: any, name?: string): Promise<boolean | null>;
|
|
347
|
+
sessionTextCommandPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
348
|
+
sessionTextFree(params?: any, name?: string): Promise<boolean | null>;
|
|
349
|
+
sessionPhotoCaption(params?: any, name?: string): Promise<boolean | null>;
|
|
350
|
+
sessionPhotoCaptionPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
351
|
+
sessionPhotoCaptionCommand(params?: any, name?: string): Promise<boolean | null>;
|
|
352
|
+
sessionPhotoCaptionCommandPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
353
|
+
sessionPhotoFree(params?: any, name?: string): Promise<boolean | null>;
|
|
354
|
+
sessionVideoCaption(params?: any, name?: string): Promise<boolean | null>;
|
|
355
|
+
sessionVideoCaptionPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
356
|
+
sessionVideoCaptionCommand(params?: any, name?: string): Promise<boolean | null>;
|
|
357
|
+
sessionVideoCaptionCommandPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
358
|
+
sessionVideoFree(params?: any, name?: string): Promise<boolean | null>;
|
|
359
|
+
sessionAudioCaption(params?: any, name?: string): Promise<boolean | null>;
|
|
360
|
+
sessionAudioCaptionPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
361
|
+
sessionAudioCaptionCommand(params?: any, name?: string): Promise<boolean | null>;
|
|
362
|
+
sessionAudioCaptionCommandPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
363
|
+
sessionAudioFree(params?: any, name?: string): Promise<boolean | null>;
|
|
364
|
+
sessionDocumentCaption(params?: any, name?: string): Promise<boolean | null>;
|
|
365
|
+
sessionDocumentCaptionPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
366
|
+
sessionDocumentCaptionCommand(params?: any, name?: string): Promise<boolean | null>;
|
|
367
|
+
sessionDocumentCaptionCommandPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
368
|
+
sessionDocumentFree(params?: any, name?: string): Promise<boolean | null>;
|
|
369
|
+
sessionAnimationCaption(params?: any, name?: string): Promise<boolean | null>;
|
|
370
|
+
sessionAnimationCaptionPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
371
|
+
sessionAnimationCaptionCommand(params?: any, name?: string): Promise<boolean | null>;
|
|
372
|
+
sessionAnimationCaptionCommandPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
373
|
+
sessionAnimationFree(params?: any, name?: string): Promise<boolean | null>;
|
|
374
|
+
sessionVoiceCaption(params?: any, name?: string): Promise<boolean | null>;
|
|
375
|
+
sessionVoiceCaptionPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
376
|
+
sessionVoiceCaptionCommand(params?: any, name?: string): Promise<boolean | null>;
|
|
377
|
+
sessionVoiceCaptionCommandPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
378
|
+
sessionVoiceFree(params?: any, name?: string): Promise<boolean | null>;
|
|
379
|
+
sessionVideoNoteCaption(params?: any, name?: string): Promise<boolean | null>;
|
|
380
|
+
sessionVideoNoteCaptionPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
381
|
+
sessionVideoNoteCaptionCommand(params?: any, name?: string): Promise<boolean | null>;
|
|
382
|
+
sessionVideoNoteCaptionCommandPayload(params?: any, name?: string): Promise<boolean | null>;
|
|
383
|
+
sessionVideoNoteFree(params?: any, name?: string): Promise<boolean | null>;
|
|
384
|
+
sessionStickerFree(params?: any, name?: string): Promise<boolean | null>;
|
|
385
|
+
sessionLocationFree(params?: any, name?: string): Promise<boolean | null>;
|
|
386
|
+
sessionContactFree(params?: any, name?: string): Promise<boolean | null>;
|
|
387
|
+
sessionToCallback(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
388
|
+
sessionToCallbackPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
389
|
+
sessionToText(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
390
|
+
sessionToTextPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
391
|
+
sessionToTextCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
392
|
+
sessionToTextCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
393
|
+
sessionToTextFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
394
|
+
sessionToPhotoCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
395
|
+
sessionToPhotoCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
396
|
+
sessionToPhotoCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
397
|
+
sessionToPhotoCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
398
|
+
sessionToPhotoFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
399
|
+
sessionToVideoCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
400
|
+
sessionToVideoCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
401
|
+
sessionToVideoCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
402
|
+
sessionToVideoCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
403
|
+
sessionToVideoFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
404
|
+
sessionToAudioCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
405
|
+
sessionToAudioCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
406
|
+
sessionToAudioCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
407
|
+
sessionToAudioCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
408
|
+
sessionToAudioFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
409
|
+
sessionToDocumentCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
410
|
+
sessionToDocumentCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
411
|
+
sessionToDocumentCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
412
|
+
sessionToDocumentCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
413
|
+
sessionToDocumentFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
414
|
+
sessionToAnimationCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
415
|
+
sessionToAnimationCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
416
|
+
sessionToAnimationCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
417
|
+
sessionToAnimationCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
418
|
+
sessionToAnimationFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
419
|
+
sessionToVoiceCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
420
|
+
sessionToVoiceCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
421
|
+
sessionToVoiceCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
422
|
+
sessionToVoiceCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
423
|
+
sessionToVoiceFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
424
|
+
sessionToVideoNoteCaption(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
425
|
+
sessionToVideoNoteCaptionPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
426
|
+
sessionToVideoNoteCaptionCommand(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
427
|
+
sessionToVideoNoteCaptionCommandPayload(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
428
|
+
sessionToVideoNoteFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
429
|
+
sessionToStickerFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
430
|
+
sessionToLocationFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
431
|
+
sessionToContactFree(paramsAdd?: any, name?: string): Promise<boolean | null>;
|
|
432
|
+
buildIntent(str?: string, fbCallbackData?: boolean): string;
|
|
433
|
+
buildSessionMethod(prefix: string, name: string | undefined): string;
|
|
434
|
+
buildSessionMethodCallback(name?: string): string;
|
|
435
|
+
buildSessionMethodCallbackPayload(name?: string): string;
|
|
436
|
+
buildSessionMethodText(name?: string): string;
|
|
437
|
+
buildSessionMethodTextPayload(name?: string): string;
|
|
438
|
+
buildSessionMethodTextCommand(name?: string): string;
|
|
439
|
+
buildSessionMethodTextCommandPayload(name?: string): string;
|
|
440
|
+
buildSessionMethodTextFree(name?: string): string;
|
|
441
|
+
buildSessionMethodPhotoCaption(name?: string): string;
|
|
442
|
+
buildSessionMethodPhotoCaptionPayload(name?: string): string;
|
|
443
|
+
buildSessionMethodPhotoCaptionCommand(name?: string): string;
|
|
444
|
+
buildSessionMethodPhotoCaptionCommandPayload(name?: string): string;
|
|
445
|
+
buildSessionMethodPhotoFree(name?: string): string;
|
|
446
|
+
buildSessionMethodVideoCaption(name?: string): string;
|
|
447
|
+
buildSessionMethodVideoCaptionPayload(name?: string): string;
|
|
448
|
+
buildSessionMethodVideoCaptionCommand(name?: string): string;
|
|
449
|
+
buildSessionMethodVideoCaptionCommandPayload(name?: string): string;
|
|
450
|
+
buildSessionMethodVideoFree(name?: string): string;
|
|
451
|
+
buildSessionMethodAudioCaption(name?: string): string;
|
|
452
|
+
buildSessionMethodAudioCaptionPayload(name?: string): string;
|
|
453
|
+
buildSessionMethodAudioCaptionCommand(name?: string): string;
|
|
454
|
+
buildSessionMethodAudioCaptionCommandPayload(name?: string): string;
|
|
455
|
+
buildSessionMethodAudioFree(name?: string): string;
|
|
456
|
+
buildSessionMethodDocumentCaption(name?: string): string;
|
|
457
|
+
buildSessionMethodDocumentCaptionPayload(name?: string): string;
|
|
458
|
+
buildSessionMethodDocumentCaptionCommand(name?: string): string;
|
|
459
|
+
buildSessionMethodDocumentCaptionCommandPayload(name?: string): string;
|
|
460
|
+
buildSessionMethodDocumentFree(name?: string): string;
|
|
461
|
+
buildSessionMethodAnimationCaption(name?: string): string;
|
|
462
|
+
buildSessionMethodAnimationCaptionPayload(name?: string): string;
|
|
463
|
+
buildSessionMethodAnimationCaptionCommand(name?: string): string;
|
|
464
|
+
buildSessionMethodAnimationCaptionCommandPayload(name?: string): string;
|
|
465
|
+
buildSessionMethodAnimationFree(name?: string): string;
|
|
466
|
+
buildSessionMethodVoiceCaption(name?: string): string;
|
|
467
|
+
buildSessionMethodVoiceCaptionPayload(name?: string): string;
|
|
468
|
+
buildSessionMethodVoiceCaptionCommand(name?: string): string;
|
|
469
|
+
buildSessionMethodVoiceCaptionCommandPayload(name?: string): string;
|
|
470
|
+
buildSessionMethodVoiceFree(name?: string): string;
|
|
471
|
+
buildSessionMethodVideoNoteCaption(name?: string): string;
|
|
472
|
+
buildSessionMethodVideoNoteCaptionPayload(name?: string): string;
|
|
473
|
+
buildSessionMethodVideoNoteCaptionCommand(name?: string): string;
|
|
474
|
+
buildSessionMethodVideoNoteCaptionCommandPayload(name?: string): string;
|
|
475
|
+
buildSessionMethodVideoNoteFree(name?: string): string;
|
|
476
|
+
buildSessionMethodStickerFree(name?: string): string;
|
|
477
|
+
buildSessionMethodLocationFree(name?: string): string;
|
|
478
|
+
buildSessionMethodContactFree(name?: string): string;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
declare abstract class BaseGuard extends BasePage {
|
|
482
|
+
pageData: {
|
|
483
|
+
name: string;
|
|
484
|
+
callbackData: (...args: any) => string | any;
|
|
485
|
+
};
|
|
486
|
+
constructor(page: {
|
|
487
|
+
ctx: Ctx;
|
|
488
|
+
data?: any;
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
declare const Page = class extends BasePage {}
|
|
493
|
+
type IPageBase = typeof Page
|
|
494
|
+
|
|
495
|
+
declare class Gramstax {
|
|
9
496
|
templateManager: TemplateManager;
|
|
10
497
|
cacheKeyboard: Map<any, any>;
|
|
11
498
|
cacheSession: CacheExternal;
|
|
499
|
+
log: LoggingPretty$1 | undefined;
|
|
500
|
+
bot: Bot;
|
|
12
501
|
pages: {
|
|
13
502
|
all: Record<string, IPageBase>;
|
|
14
503
|
dynamic: string[];
|
|
@@ -387,12 +876,10 @@ export declare class Gramstax {
|
|
|
387
876
|
lenListFuncStaticIntent: 17;
|
|
388
877
|
lenListFuncStaticSession: 45;
|
|
389
878
|
};
|
|
390
|
-
log: LoggingPretty;
|
|
391
|
-
bot: Bot;
|
|
392
879
|
constructor(params: {
|
|
393
880
|
token: string;
|
|
394
881
|
deploy: string;
|
|
395
|
-
log?: LoggingPretty;
|
|
882
|
+
log?: LoggingPretty$1;
|
|
396
883
|
cacheSession?: CacheExternal;
|
|
397
884
|
cacheKeyboard?: Map<any, any>;
|
|
398
885
|
templateManager?: TemplateManager;
|
|
@@ -783,7 +1270,7 @@ export declare class Gramstax {
|
|
|
783
1270
|
lenListFuncStaticIntent: 17;
|
|
784
1271
|
lenListFuncStaticSession: 45;
|
|
785
1272
|
};
|
|
786
|
-
pageRoutes(ctx: Ctx, fromListener: `callback` | keyof typeof this.pages.dynamicSpesific): Promise<any | null>;
|
|
1273
|
+
pageRoutes(ctx: Ctx, fromListener: `callback` | keyof typeof this$1.pages.dynamicSpesific): Promise<any | null>;
|
|
787
1274
|
hookBeforeRoute(ctx: Ctx, listenerName: string): Promise<boolean>;
|
|
788
1275
|
hookErrorPage(ctx: Ctx, listenerName: string, error: any, isEdit: boolean): Promise<void>;
|
|
789
1276
|
hookErrorInputNotFoundPage(ctx: Ctx): Promise<void>;
|
|
@@ -801,4 +1288,5 @@ export declare class Gramstax {
|
|
|
801
1288
|
onMessageLocation(ct: Context): Promise<void>;
|
|
802
1289
|
onMessageContact(ct: Context): Promise<void>;
|
|
803
1290
|
}
|
|
804
|
-
|
|
1291
|
+
|
|
1292
|
+
export { BaseGeneral, BaseGuard, BasePage, CacheExternal, Ctx, Gramstax, TemplateEngine, TemplateManager };
|