gramstax 0.0.1 → 0.0.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/src/index.cjs +2 -0
- package/dist/src/index.cjs.map +1 -0
- package/dist/src/{core/bot.d.ts → index.d.cts} +500 -12
- 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
package/src/base/page.ts
DELETED
|
@@ -1,1111 +0,0 @@
|
|
|
1
|
-
import { Ctx } from "../core/ctx"
|
|
2
|
-
import { InlineKeyboard, Keyboard } from "../grammy"
|
|
3
|
-
|
|
4
|
-
export abstract class BasePage extends Ctx {
|
|
5
|
-
public static template?: string // string html
|
|
6
|
-
public static data: { name: string; callbackData: (...args: any) => string | any } // for external access (**.data). example StartPage.data.callbackData
|
|
7
|
-
|
|
8
|
-
// =============== most common used function
|
|
9
|
-
public transition?(...args: any): Promise<void>
|
|
10
|
-
public internal?(...args: any): Promise<void>
|
|
11
|
-
public notify?(...args: any): Promise<void>
|
|
12
|
-
|
|
13
|
-
// =============== route function
|
|
14
|
-
// callback
|
|
15
|
-
public callback?(): Promise<void> // example: start
|
|
16
|
-
public callbackPayload?(): Promise<void> // example: start:{DYNAMIC}
|
|
17
|
-
// text
|
|
18
|
-
public text?(): Promise<void> // example: start
|
|
19
|
-
public textPayload?(): Promise<void> // example: start {...DYNAMIC}
|
|
20
|
-
public textCommand?(): Promise<void> // example: /start
|
|
21
|
-
public textCommandPayload?(): Promise<void> // example: /start {...DYNAMIC}
|
|
22
|
-
public textFree?(): Promise<void> // example (for session): {...DYNAMIC}
|
|
23
|
-
// photo
|
|
24
|
-
public photoCaption?(): Promise<void>
|
|
25
|
-
public photoCaptionPayload?(): Promise<void>
|
|
26
|
-
public photoCaptionCommand?(): Promise<void>
|
|
27
|
-
public photoCaptionCommandPayload?(): Promise<void>
|
|
28
|
-
public photoFree?(): Promise<void>
|
|
29
|
-
// video
|
|
30
|
-
public videoCaption?(): Promise<void>
|
|
31
|
-
public videoCaptionPayload?(): Promise<void>
|
|
32
|
-
public videoCaptionCommand?(): Promise<void>
|
|
33
|
-
public videoCaptionCommandPayload?(): Promise<void>
|
|
34
|
-
public videoFree?(): Promise<void>
|
|
35
|
-
// audio
|
|
36
|
-
public audioCaption?(): Promise<void>
|
|
37
|
-
public audioCaptionPayload?(): Promise<void>
|
|
38
|
-
public audioCaptionCommand?(): Promise<void>
|
|
39
|
-
public audioCaptionCommandPayload?(): Promise<void>
|
|
40
|
-
public audioFree?(): Promise<void>
|
|
41
|
-
// document
|
|
42
|
-
public documentCaption?(): Promise<void>
|
|
43
|
-
public documentCaptionPayload?(): Promise<void>
|
|
44
|
-
public documentCaptionCommand?(): Promise<void>
|
|
45
|
-
public documentCaptionCommandPayload?(): Promise<void>
|
|
46
|
-
public documentFree?(): Promise<void>
|
|
47
|
-
// animation
|
|
48
|
-
public animationCaption?(): Promise<void>
|
|
49
|
-
public animationCaptionPayload?(): Promise<void>
|
|
50
|
-
public animationCaptionCommand?(): Promise<void>
|
|
51
|
-
public animationCaptionCommandPayload?(): Promise<void>
|
|
52
|
-
public animationFree?(): Promise<void>
|
|
53
|
-
// voiceNote
|
|
54
|
-
public voiceCaption?(): Promise<void>
|
|
55
|
-
public voiceCaptionPayload?(): Promise<void>
|
|
56
|
-
public voiceCaptionCommand?(): Promise<void>
|
|
57
|
-
public voiceCaptionCommandPayload?(): Promise<void>
|
|
58
|
-
public voiceFree?(): Promise<void>
|
|
59
|
-
// videoNote
|
|
60
|
-
public videoNoteCaption?(): Promise<void>
|
|
61
|
-
public videoNoteCaptionPayload?(): Promise<void>
|
|
62
|
-
public videoNoteCaptionCommand?(): Promise<void>
|
|
63
|
-
public videoNoteCaptionCommandPayload?(): Promise<void>
|
|
64
|
-
public videoNoteFree?(): Promise<void>
|
|
65
|
-
// sticker
|
|
66
|
-
public stickerFree?(): Promise<void>
|
|
67
|
-
// location
|
|
68
|
-
public locationFree?(): Promise<void>
|
|
69
|
-
// contact
|
|
70
|
-
public contactFree?(): Promise<void>
|
|
71
|
-
// all
|
|
72
|
-
public free?(): Promise<void>
|
|
73
|
-
|
|
74
|
-
public ctx: Ctx
|
|
75
|
-
public constructor(ctx: Ctx & { ctx?: Ctx }) {
|
|
76
|
-
super(ctx.ct, ctx.templateManager, ctx.cacheSession, ctx.cacheKeyboard)
|
|
77
|
-
this.session = ctx?.ctx?.session || ctx.session // set to this PageBase
|
|
78
|
-
this.ctx = ctx?.ctx || ctx // if have ctx.ctx (from Page.ctx) use it, otherwise ctx (from CtxBot)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// =============== build data
|
|
82
|
-
|
|
83
|
-
public static buildData<C extends ((...args: any[]) => any) | undefined = undefined>(callback?: C) {
|
|
84
|
-
return {
|
|
85
|
-
name: ``,
|
|
86
|
-
callbackData: callback
|
|
87
|
-
? function (this: { name: string }, ...args: Parameters<Exclude<C, undefined>>): ReturnType<Exclude<C, undefined>> {
|
|
88
|
-
const params = callback(...args)
|
|
89
|
-
return `${this.name}${params === undefined ? `` : `:${params}`}` as any
|
|
90
|
-
}
|
|
91
|
-
: function (this: { name: string }) {
|
|
92
|
-
return this?.name
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// =============== build keyboard
|
|
98
|
-
|
|
99
|
-
public buildInlineKeyboard(callback: (kb: InlineKeyboard, arr: any[]) => InlineKeyboard, params?: { baseId?: any; data?: Record<string, any>; cache?: boolean }): InlineKeyboard {
|
|
100
|
-
const tkey = this.data.name
|
|
101
|
-
if (params?.cache === true) {
|
|
102
|
-
const key = `${tkey}:${this.languageCode}:inline`
|
|
103
|
-
const ckb = this.cacheKeyboard.get(key)
|
|
104
|
-
if (!ckb) {
|
|
105
|
-
const ikb = new InlineKeyboard()
|
|
106
|
-
const arr = this.templateManager.getKeyboard(tkey, params?.baseId, this.languageCode, `inline`, params?.data)
|
|
107
|
-
const rkb = callback(ikb, arr)
|
|
108
|
-
this.cacheKeyboard.set(key, rkb)
|
|
109
|
-
return rkb
|
|
110
|
-
}
|
|
111
|
-
return ckb
|
|
112
|
-
}
|
|
113
|
-
const ikb = new InlineKeyboard()
|
|
114
|
-
const arr = this.templateManager.getKeyboard(tkey, params?.baseId, this.languageCode, `inline`, params?.data)
|
|
115
|
-
const rkb = callback(ikb, arr)
|
|
116
|
-
return rkb
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
public buildKeyboard(callback: (kb: Keyboard, arr: any[]) => Keyboard, params?: { baseId?: any; data?: Record<string, any>; cache?: boolean }): Keyboard {
|
|
120
|
-
const tkey = this.data.name
|
|
121
|
-
if (params?.cache === true) {
|
|
122
|
-
const key = `${tkey}:${this.languageCode}:default`
|
|
123
|
-
const ckb = this.cacheKeyboard.get(key)
|
|
124
|
-
if (!ckb) {
|
|
125
|
-
const kb = new Keyboard()
|
|
126
|
-
const arr = this.templateManager.getKeyboard(tkey, params?.baseId, this.languageCode, `default`, params?.data)
|
|
127
|
-
const rkb = callback(kb, arr)
|
|
128
|
-
rkb.resized(true)
|
|
129
|
-
this.cacheKeyboard.set(key, rkb)
|
|
130
|
-
return rkb
|
|
131
|
-
}
|
|
132
|
-
return ckb
|
|
133
|
-
}
|
|
134
|
-
const kb = new Keyboard()
|
|
135
|
-
const arr = this.templateManager.getKeyboard(tkey, params?.baseId, this.languageCode, `default`, params?.data)
|
|
136
|
-
const rkb = callback(kb, arr)
|
|
137
|
-
rkb.resized()
|
|
138
|
-
return rkb
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// =============== session validate
|
|
142
|
-
// callback
|
|
143
|
-
|
|
144
|
-
public validateSessionCallback(method?: string, name?: string) {
|
|
145
|
-
if (method === undefined) {
|
|
146
|
-
method = this.session.method
|
|
147
|
-
}
|
|
148
|
-
return method === undefined ? false : method === this.buildSessionMethodCallback(name)
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
public validateSessionCallbackPayload(method?: string, name?: string) {
|
|
152
|
-
if (method === undefined) {
|
|
153
|
-
method = this.session.method
|
|
154
|
-
}
|
|
155
|
-
return method === undefined ? false : method === this.buildSessionMethodCallbackPayload(name)
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// text
|
|
159
|
-
|
|
160
|
-
public validateSessionText(method?: string, name?: string) {
|
|
161
|
-
if (method === undefined) {
|
|
162
|
-
method = this.session.method
|
|
163
|
-
}
|
|
164
|
-
return method === undefined ? false : method === this.buildSessionMethodText(name)
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
public validateSessionTextPayload(method?: string, name?: string) {
|
|
168
|
-
if (method === undefined) {
|
|
169
|
-
method = this.session.method
|
|
170
|
-
}
|
|
171
|
-
return method === undefined ? false : method === this.buildSessionMethodTextPayload(name)
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
public validateSessionTextCommand(method?: string, name?: string) {
|
|
175
|
-
if (method === undefined) {
|
|
176
|
-
method = this.session.method
|
|
177
|
-
}
|
|
178
|
-
return method === undefined ? false : method === this.buildSessionMethodTextCommand(name)
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
public validateSessionTextCommandPayload(method?: string, name?: string) {
|
|
182
|
-
if (method === undefined) {
|
|
183
|
-
method = this.session.method
|
|
184
|
-
}
|
|
185
|
-
return method === undefined ? false : method === this.buildSessionMethodTextCommandPayload(name)
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
public validateSessionTextFree(method?: string, name?: string) {
|
|
189
|
-
if (method === undefined) {
|
|
190
|
-
method = this.session.method
|
|
191
|
-
}
|
|
192
|
-
return method === undefined ? false : method === this.buildSessionMethodTextFree(name)
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// photo
|
|
196
|
-
|
|
197
|
-
public validateSessionPhotoCaption(method?: string, name?: string) {
|
|
198
|
-
if (method === undefined) {
|
|
199
|
-
method = this.session.method
|
|
200
|
-
}
|
|
201
|
-
return method === undefined ? false : method === this.buildSessionMethodPhotoCaption(name)
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
public validateSessionPhotoCaptionPayload(method?: string, name?: string) {
|
|
205
|
-
if (method === undefined) {
|
|
206
|
-
method = this.session.method
|
|
207
|
-
}
|
|
208
|
-
return method === undefined ? false : method === this.buildSessionMethodPhotoCaptionPayload(name)
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
public validateSessionPhotoCaptionCommand(method?: string, name?: string) {
|
|
212
|
-
if (method === undefined) {
|
|
213
|
-
method = this.session.method
|
|
214
|
-
}
|
|
215
|
-
return method === undefined ? false : method === this.buildSessionMethodPhotoCaptionCommand(name)
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
public validateSessionPhotoCaptionCommandPayload(method?: string, name?: string) {
|
|
219
|
-
if (method === undefined) {
|
|
220
|
-
method = this.session.method
|
|
221
|
-
}
|
|
222
|
-
return method === undefined ? false : method === this.buildSessionMethodPhotoCaptionCommandPayload(name)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
public validateSessionPhotoFree(method?: string, name?: string) {
|
|
226
|
-
if (method === undefined) {
|
|
227
|
-
method = this.session.method
|
|
228
|
-
}
|
|
229
|
-
return method === undefined ? false : method === this.buildSessionMethodPhotoFree(name)
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// video
|
|
233
|
-
|
|
234
|
-
public validateSessionVideoCaption(method?: string, name?: string) {
|
|
235
|
-
if (method === undefined) {
|
|
236
|
-
method = this.session.method
|
|
237
|
-
}
|
|
238
|
-
return method === undefined ? false : method === this.buildSessionMethodVideoCaption(name)
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
public validateSessionVideoCaptionPayload(method?: string, name?: string) {
|
|
242
|
-
if (method === undefined) {
|
|
243
|
-
method = this.session.method
|
|
244
|
-
}
|
|
245
|
-
return method === undefined ? false : method === this.buildSessionMethodVideoCaptionPayload(name)
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
public validateSessionVideoCaptionCommand(method?: string, name?: string) {
|
|
249
|
-
if (method === undefined) {
|
|
250
|
-
method = this.session.method
|
|
251
|
-
}
|
|
252
|
-
return method === undefined ? false : method === this.buildSessionMethodVideoCaptionCommand(name)
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
public validateSessionVideoCaptionCommandPayload(method?: string, name?: string) {
|
|
256
|
-
if (method === undefined) {
|
|
257
|
-
method = this.session.method
|
|
258
|
-
}
|
|
259
|
-
return method === undefined ? false : method === this.buildSessionMethodVideoCaptionCommandPayload(name)
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
public validateSessionVideoFree(method?: string, name?: string) {
|
|
263
|
-
if (method === undefined) {
|
|
264
|
-
method = this.session.method
|
|
265
|
-
}
|
|
266
|
-
return method === undefined ? false : method === this.buildSessionMethodVideoFree(name)
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// audio
|
|
270
|
-
|
|
271
|
-
public validateSessionAudioCaption(method?: string, name?: string) {
|
|
272
|
-
if (method === undefined) {
|
|
273
|
-
method = this.session.method
|
|
274
|
-
}
|
|
275
|
-
return method === undefined ? false : method === this.buildSessionMethodAudioCaption(name)
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
public validateSessionAudioCaptionPayload(method?: string, name?: string) {
|
|
279
|
-
if (method === undefined) {
|
|
280
|
-
method = this.session.method
|
|
281
|
-
}
|
|
282
|
-
return method === undefined ? false : method === this.buildSessionMethodAudioCaptionPayload(name)
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
public validateSessionAudioCaptionCommand(method?: string, name?: string) {
|
|
286
|
-
if (method === undefined) {
|
|
287
|
-
method = this.session.method
|
|
288
|
-
}
|
|
289
|
-
return method === undefined ? false : method === this.buildSessionMethodAudioCaptionCommand(name)
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
public validateSessionAudioCaptionCommandPayload(method?: string, name?: string) {
|
|
293
|
-
if (method === undefined) {
|
|
294
|
-
method = this.session.method
|
|
295
|
-
}
|
|
296
|
-
return method === undefined ? false : method === this.buildSessionMethodAudioCaptionCommandPayload(name)
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
public validateSessionAudioFree(method?: string, name?: string) {
|
|
300
|
-
if (method === undefined) {
|
|
301
|
-
method = this.session.method
|
|
302
|
-
}
|
|
303
|
-
return method === undefined ? false : method === this.buildSessionMethodAudioFree(name)
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
// document
|
|
307
|
-
|
|
308
|
-
public validateSessionDocumentCaption(method?: string, name?: string) {
|
|
309
|
-
if (method === undefined) {
|
|
310
|
-
method = this.session.method
|
|
311
|
-
}
|
|
312
|
-
return method === undefined ? false : method === this.buildSessionMethodDocumentCaption(name)
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
public validateSessionDocumentCaptionPayload(method?: string, name?: string) {
|
|
316
|
-
if (method === undefined) {
|
|
317
|
-
method = this.session.method
|
|
318
|
-
}
|
|
319
|
-
return method === undefined ? false : method === this.buildSessionMethodDocumentCaptionPayload(name)
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
public validateSessionDocumentCaptionCommand(method?: string, name?: string) {
|
|
323
|
-
if (method === undefined) {
|
|
324
|
-
method = this.session.method
|
|
325
|
-
}
|
|
326
|
-
return method === undefined ? false : method === this.buildSessionMethodDocumentCaptionCommand(name)
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
public validateSessionDocumentCaptionCommandPayload(method?: string, name?: string) {
|
|
330
|
-
if (method === undefined) {
|
|
331
|
-
method = this.session.method
|
|
332
|
-
}
|
|
333
|
-
return method === undefined ? false : method === this.buildSessionMethodDocumentCaptionCommandPayload(name)
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
public validateSessionDocumentFree(method?: string, name?: string) {
|
|
337
|
-
if (method === undefined) {
|
|
338
|
-
method = this.session.method
|
|
339
|
-
}
|
|
340
|
-
return method === undefined ? false : method === this.buildSessionMethodDocumentFree(name)
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
// animation
|
|
344
|
-
|
|
345
|
-
public validateSessionAnimationCaption(method?: string, name?: string) {
|
|
346
|
-
if (method === undefined) {
|
|
347
|
-
method = this.session.method
|
|
348
|
-
}
|
|
349
|
-
return method === undefined ? false : method === this.buildSessionMethodAnimationCaption(name)
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
public validateSessionAnimationCaptionPayload(method?: string, name?: string) {
|
|
353
|
-
if (method === undefined) {
|
|
354
|
-
method = this.session.method
|
|
355
|
-
}
|
|
356
|
-
return method === undefined ? false : method === this.buildSessionMethodAnimationCaptionPayload(name)
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
public validateSessionAnimationCaptionCommand(method?: string, name?: string) {
|
|
360
|
-
if (method === undefined) {
|
|
361
|
-
method = this.session.method
|
|
362
|
-
}
|
|
363
|
-
return method === undefined ? false : method === this.buildSessionMethodAnimationCaptionCommand(name)
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
public validateSessionAnimationCaptionCommandPayload(method?: string, name?: string) {
|
|
367
|
-
if (method === undefined) {
|
|
368
|
-
method = this.session.method
|
|
369
|
-
}
|
|
370
|
-
return method === undefined ? false : method === this.buildSessionMethodAnimationCaptionCommandPayload(name)
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
public validateSessionAnimationFree(method?: string, name?: string) {
|
|
374
|
-
if (method === undefined) {
|
|
375
|
-
method = this.session.method
|
|
376
|
-
}
|
|
377
|
-
return method === undefined ? false : method === this.buildSessionMethodAnimationFree(name)
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
// voice
|
|
381
|
-
|
|
382
|
-
public validateSessionVoiceCaption(method?: string, name?: string) {
|
|
383
|
-
if (method === undefined) {
|
|
384
|
-
method = this.session.method
|
|
385
|
-
}
|
|
386
|
-
return method === undefined ? false : method === this.buildSessionMethodVoiceCaption(name)
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
public validateSessionVoiceCaptionPayload(method?: string, name?: string) {
|
|
390
|
-
if (method === undefined) {
|
|
391
|
-
method = this.session.method
|
|
392
|
-
}
|
|
393
|
-
return method === undefined ? false : method === this.buildSessionMethodVoiceCaptionPayload(name)
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
public validateSessionVoiceCaptionCommand(method?: string, name?: string) {
|
|
397
|
-
if (method === undefined) {
|
|
398
|
-
method = this.session.method
|
|
399
|
-
}
|
|
400
|
-
return method === undefined ? false : method === this.buildSessionMethodVoiceCaptionCommand(name)
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
public validateSessionVoiceCaptionCommandPayload(method?: string, name?: string) {
|
|
404
|
-
if (method === undefined) {
|
|
405
|
-
method = this.session.method
|
|
406
|
-
}
|
|
407
|
-
return method === undefined ? false : method === this.buildSessionMethodVoiceCaptionCommandPayload(name)
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
public validateSessionVoiceFree(method?: string, name?: string) {
|
|
411
|
-
if (method === undefined) {
|
|
412
|
-
method = this.session.method
|
|
413
|
-
}
|
|
414
|
-
return method === undefined ? false : method === this.buildSessionMethodVoiceFree(name)
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
// video note
|
|
418
|
-
|
|
419
|
-
public validateSessionVideoNoteCaption(method?: string, name?: string) {
|
|
420
|
-
if (method === undefined) {
|
|
421
|
-
method = this.session.method
|
|
422
|
-
}
|
|
423
|
-
return method === undefined ? false : method === this.buildSessionMethodVideoNoteCaption(name)
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
public validateSessionVideoNoteCaptionPayload(method?: string, name?: string) {
|
|
427
|
-
if (method === undefined) {
|
|
428
|
-
method = this.session.method
|
|
429
|
-
}
|
|
430
|
-
return method === undefined ? false : method === this.buildSessionMethodVideoNoteCaptionPayload(name)
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
public validateSessionVideoNoteCaptionCommand(method?: string, name?: string) {
|
|
434
|
-
if (method === undefined) {
|
|
435
|
-
method = this.session.method
|
|
436
|
-
}
|
|
437
|
-
return method === undefined ? false : method === this.buildSessionMethodVideoNoteCaptionCommand(name)
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
public validateSessionVideoNoteCaptionCommandPayload(method?: string, name?: string) {
|
|
441
|
-
if (method === undefined) {
|
|
442
|
-
method = this.session.method
|
|
443
|
-
}
|
|
444
|
-
return method === undefined ? false : method === this.buildSessionMethodVideoNoteCaptionCommandPayload(name)
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
public validateSessionVideoNoteFree(method?: string, name?: string) {
|
|
448
|
-
if (method === undefined) {
|
|
449
|
-
method = this.session.method
|
|
450
|
-
}
|
|
451
|
-
return method === undefined ? false : method === this.buildSessionMethodVideoNoteFree(name)
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
// sticker
|
|
455
|
-
|
|
456
|
-
public validateSessionStickerFree(method?: string, name?: string) {
|
|
457
|
-
if (method === undefined) {
|
|
458
|
-
method = this.session.method
|
|
459
|
-
}
|
|
460
|
-
return method === undefined ? false : method === this.buildSessionMethodStickerFree(name)
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
// location
|
|
464
|
-
|
|
465
|
-
public validateSessionLocationFree(method?: string, name?: string) {
|
|
466
|
-
if (method === undefined) {
|
|
467
|
-
method = this.session.method
|
|
468
|
-
}
|
|
469
|
-
return method === undefined ? false : method === this.buildSessionMethodLocationFree(name)
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
// contact
|
|
473
|
-
|
|
474
|
-
public validateSessionContactFree(method?: string, name?: string) {
|
|
475
|
-
if (method === undefined) {
|
|
476
|
-
method = this.session.method
|
|
477
|
-
}
|
|
478
|
-
return method === undefined ? false : method === this.buildSessionMethodContactFree(name)
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
// =============== session set
|
|
482
|
-
// callback
|
|
483
|
-
|
|
484
|
-
public sessionCallback(params?: any, name?: string) {
|
|
485
|
-
return this.sessionSet(this.buildSessionMethodCallback(name), params)
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
public sessionCallbackPayload(params?: any, name?: string) {
|
|
489
|
-
return this.sessionSet(this.buildSessionMethodCallbackPayload(name), params)
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
// text
|
|
493
|
-
|
|
494
|
-
public sessionText(params?: any, name?: string) {
|
|
495
|
-
return this.sessionSet(this.buildSessionMethodText(name), params)
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
public sessionTextPayload(params?: any, name?: string) {
|
|
499
|
-
return this.sessionSet(this.buildSessionMethodTextPayload(name), params)
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
public sessionTextCommand(params?: any, name?: string) {
|
|
503
|
-
return this.sessionSet(this.buildSessionMethodTextCommand(name), params)
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
public sessionTextCommandPayload(params?: any, name?: string) {
|
|
507
|
-
return this.sessionSet(this.buildSessionMethodTextCommandPayload(name), params)
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
public sessionTextFree(params?: any, name?: string) {
|
|
511
|
-
return this.sessionSet(this.buildSessionMethodTextFree(name), params)
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
// photo
|
|
515
|
-
|
|
516
|
-
public sessionPhotoCaption(params?: any, name?: string) {
|
|
517
|
-
return this.sessionSet(this.buildSessionMethodPhotoCaption(name), params)
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
public sessionPhotoCaptionPayload(params?: any, name?: string) {
|
|
521
|
-
return this.sessionSet(this.buildSessionMethodPhotoCaptionPayload(name), params)
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
public sessionPhotoCaptionCommand(params?: any, name?: string) {
|
|
525
|
-
return this.sessionSet(this.buildSessionMethodPhotoCaptionCommand(name), params)
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
public sessionPhotoCaptionCommandPayload(params?: any, name?: string) {
|
|
529
|
-
return this.sessionSet(this.buildSessionMethodPhotoCaptionCommandPayload(name), params)
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
public sessionPhotoFree(params?: any, name?: string) {
|
|
533
|
-
return this.sessionSet(this.buildSessionMethodPhotoFree(name), params)
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
// video
|
|
537
|
-
|
|
538
|
-
public sessionVideoCaption(params?: any, name?: string) {
|
|
539
|
-
return this.sessionSet(this.buildSessionMethodVideoCaption(name), params)
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
public sessionVideoCaptionPayload(params?: any, name?: string) {
|
|
543
|
-
return this.sessionSet(this.buildSessionMethodVideoCaptionPayload(name), params)
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
public sessionVideoCaptionCommand(params?: any, name?: string) {
|
|
547
|
-
return this.sessionSet(this.buildSessionMethodVideoCaptionCommand(name), params)
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
public sessionVideoCaptionCommandPayload(params?: any, name?: string) {
|
|
551
|
-
return this.sessionSet(this.buildSessionMethodVideoCaptionCommandPayload(name), params)
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
public sessionVideoFree(params?: any, name?: string) {
|
|
555
|
-
return this.sessionSet(this.buildSessionMethodVideoFree(name), params)
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
// audio
|
|
559
|
-
|
|
560
|
-
public sessionAudioCaption(params?: any, name?: string) {
|
|
561
|
-
return this.sessionSet(this.buildSessionMethodAudioCaption(name), params)
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
public sessionAudioCaptionPayload(params?: any, name?: string) {
|
|
565
|
-
return this.sessionSet(this.buildSessionMethodAudioCaptionPayload(name), params)
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
public sessionAudioCaptionCommand(params?: any, name?: string) {
|
|
569
|
-
return this.sessionSet(this.buildSessionMethodAudioCaptionCommand(name), params)
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
public sessionAudioCaptionCommandPayload(params?: any, name?: string) {
|
|
573
|
-
return this.sessionSet(this.buildSessionMethodAudioCaptionCommandPayload(name), params)
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
public sessionAudioFree(params?: any, name?: string) {
|
|
577
|
-
return this.sessionSet(this.buildSessionMethodAudioFree(name), params)
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
// document
|
|
581
|
-
|
|
582
|
-
public sessionDocumentCaption(params?: any, name?: string) {
|
|
583
|
-
return this.sessionSet(this.buildSessionMethodDocumentCaption(name), params)
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
public sessionDocumentCaptionPayload(params?: any, name?: string) {
|
|
587
|
-
return this.sessionSet(this.buildSessionMethodDocumentCaptionPayload(name), params)
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
public sessionDocumentCaptionCommand(params?: any, name?: string) {
|
|
591
|
-
return this.sessionSet(this.buildSessionMethodDocumentCaptionCommand(name), params)
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
public sessionDocumentCaptionCommandPayload(params?: any, name?: string) {
|
|
595
|
-
return this.sessionSet(this.buildSessionMethodDocumentCaptionCommandPayload(name), params)
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
public sessionDocumentFree(params?: any, name?: string) {
|
|
599
|
-
return this.sessionSet(this.buildSessionMethodDocumentFree(name), params)
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
// animation
|
|
603
|
-
|
|
604
|
-
public sessionAnimationCaption(params?: any, name?: string) {
|
|
605
|
-
return this.sessionSet(this.buildSessionMethodAnimationCaption(name), params)
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
public sessionAnimationCaptionPayload(params?: any, name?: string) {
|
|
609
|
-
return this.sessionSet(this.buildSessionMethodAnimationCaptionPayload(name), params)
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
public sessionAnimationCaptionCommand(params?: any, name?: string) {
|
|
613
|
-
return this.sessionSet(this.buildSessionMethodAnimationCaptionCommand(name), params)
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
public sessionAnimationCaptionCommandPayload(params?: any, name?: string) {
|
|
617
|
-
return this.sessionSet(this.buildSessionMethodAnimationCaptionCommandPayload(name), params)
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
public sessionAnimationFree(params?: any, name?: string) {
|
|
621
|
-
return this.sessionSet(this.buildSessionMethodAnimationFree(name), params)
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
// voice
|
|
625
|
-
|
|
626
|
-
public sessionVoiceCaption(params?: any, name?: string) {
|
|
627
|
-
return this.sessionSet(this.buildSessionMethodVoiceCaption(name), params)
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
public sessionVoiceCaptionPayload(params?: any, name?: string) {
|
|
631
|
-
return this.sessionSet(this.buildSessionMethodVoiceCaptionPayload(name), params)
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
public sessionVoiceCaptionCommand(params?: any, name?: string) {
|
|
635
|
-
return this.sessionSet(this.buildSessionMethodVoiceCaptionCommand(name), params)
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
public sessionVoiceCaptionCommandPayload(params?: any, name?: string) {
|
|
639
|
-
return this.sessionSet(this.buildSessionMethodVoiceCaptionCommandPayload(name), params)
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
public sessionVoiceFree(params?: any, name?: string) {
|
|
643
|
-
return this.sessionSet(this.buildSessionMethodVoiceFree(name), params)
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
// video note
|
|
647
|
-
|
|
648
|
-
public sessionVideoNoteCaption(params?: any, name?: string) {
|
|
649
|
-
return this.sessionSet(this.buildSessionMethodVideoNoteCaption(name), params)
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
public sessionVideoNoteCaptionPayload(params?: any, name?: string) {
|
|
653
|
-
return this.sessionSet(this.buildSessionMethodVideoNoteCaptionPayload(name), params)
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
public sessionVideoNoteCaptionCommand(params?: any, name?: string) {
|
|
657
|
-
return this.sessionSet(this.buildSessionMethodVideoNoteCaptionCommand(name), params)
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
public sessionVideoNoteCaptionCommandPayload(params?: any, name?: string) {
|
|
661
|
-
return this.sessionSet(this.buildSessionMethodVideoNoteCaptionCommandPayload(name), params)
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
public sessionVideoNoteFree(params?: any, name?: string) {
|
|
665
|
-
return this.sessionSet(this.buildSessionMethodVideoNoteFree(name), params)
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
// sticker
|
|
669
|
-
|
|
670
|
-
public sessionStickerFree(params?: any, name?: string) {
|
|
671
|
-
return this.sessionSet(this.buildSessionMethodStickerFree(name), params)
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
// location
|
|
675
|
-
|
|
676
|
-
public sessionLocationFree(params?: any, name?: string) {
|
|
677
|
-
return this.sessionSet(this.buildSessionMethodLocationFree(name), params)
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
// contact
|
|
681
|
-
|
|
682
|
-
public sessionContactFree(params?: any, name?: string) {
|
|
683
|
-
return this.sessionSet(this.buildSessionMethodContactFree(name), params)
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
// =============== session update to set
|
|
687
|
-
// callback
|
|
688
|
-
|
|
689
|
-
public sessionToCallback(paramsAdd?: any, name?: string) {
|
|
690
|
-
return this.sessionCallback({ ...this.session.params, ...paramsAdd }, name)
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
public sessionToCallbackPayload(paramsAdd?: any, name?: string) {
|
|
694
|
-
return this.sessionCallbackPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
// text
|
|
698
|
-
|
|
699
|
-
public sessionToText(paramsAdd?: any, name?: string) {
|
|
700
|
-
return this.sessionText({ ...this.session.params, ...paramsAdd }, name)
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
public sessionToTextPayload(paramsAdd?: any, name?: string) {
|
|
704
|
-
return this.sessionTextPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
public sessionToTextCommand(paramsAdd?: any, name?: string) {
|
|
708
|
-
return this.sessionTextCommand({ ...this.session.params, ...paramsAdd }, name)
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
public sessionToTextCommandPayload(paramsAdd?: any, name?: string) {
|
|
712
|
-
return this.sessionTextCommandPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
public sessionToTextFree(paramsAdd?: any, name?: string) {
|
|
716
|
-
return this.sessionTextFree({ ...this.session.params, ...paramsAdd }, name)
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
// photo
|
|
720
|
-
|
|
721
|
-
public sessionToPhotoCaption(paramsAdd?: any, name?: string) {
|
|
722
|
-
return this.sessionPhotoCaption({ ...this.session.params, ...paramsAdd }, name)
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
public sessionToPhotoCaptionPayload(paramsAdd?: any, name?: string) {
|
|
726
|
-
return this.sessionPhotoCaptionPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
public sessionToPhotoCaptionCommand(paramsAdd?: any, name?: string) {
|
|
730
|
-
return this.sessionPhotoCaptionCommand({ ...this.session.params, ...paramsAdd }, name)
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
public sessionToPhotoCaptionCommandPayload(paramsAdd?: any, name?: string) {
|
|
734
|
-
return this.sessionPhotoCaptionCommandPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
public sessionToPhotoFree(paramsAdd?: any, name?: string) {
|
|
738
|
-
return this.sessionPhotoFree({ ...this.session.params, ...paramsAdd }, name)
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
// video
|
|
742
|
-
|
|
743
|
-
public sessionToVideoCaption(paramsAdd?: any, name?: string) {
|
|
744
|
-
return this.sessionVideoCaption({ ...this.session.params, ...paramsAdd }, name)
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
public sessionToVideoCaptionPayload(paramsAdd?: any, name?: string) {
|
|
748
|
-
return this.sessionVideoCaptionPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
public sessionToVideoCaptionCommand(paramsAdd?: any, name?: string) {
|
|
752
|
-
return this.sessionVideoCaptionCommand({ ...this.session.params, ...paramsAdd }, name)
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
public sessionToVideoCaptionCommandPayload(paramsAdd?: any, name?: string) {
|
|
756
|
-
return this.sessionVideoCaptionCommandPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
public sessionToVideoFree(paramsAdd?: any, name?: string) {
|
|
760
|
-
return this.sessionVideoFree({ ...this.session.params, ...paramsAdd }, name)
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
// audio
|
|
764
|
-
|
|
765
|
-
public sessionToAudioCaption(paramsAdd?: any, name?: string) {
|
|
766
|
-
return this.sessionAudioCaption({ ...this.session.params, ...paramsAdd }, name)
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
public sessionToAudioCaptionPayload(paramsAdd?: any, name?: string) {
|
|
770
|
-
return this.sessionAudioCaptionPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
public sessionToAudioCaptionCommand(paramsAdd?: any, name?: string) {
|
|
774
|
-
return this.sessionAudioCaptionCommand({ ...this.session.params, ...paramsAdd }, name)
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
public sessionToAudioCaptionCommandPayload(paramsAdd?: any, name?: string) {
|
|
778
|
-
return this.sessionAudioCaptionCommandPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
public sessionToAudioFree(paramsAdd?: any, name?: string) {
|
|
782
|
-
return this.sessionAudioFree({ ...this.session.params, ...paramsAdd }, name)
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
// document
|
|
786
|
-
|
|
787
|
-
public sessionToDocumentCaption(paramsAdd?: any, name?: string) {
|
|
788
|
-
return this.sessionDocumentCaption({ ...this.session.params, ...paramsAdd }, name)
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
public sessionToDocumentCaptionPayload(paramsAdd?: any, name?: string) {
|
|
792
|
-
return this.sessionDocumentCaptionPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
public sessionToDocumentCaptionCommand(paramsAdd?: any, name?: string) {
|
|
796
|
-
return this.sessionDocumentCaptionCommand({ ...this.session.params, ...paramsAdd }, name)
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
public sessionToDocumentCaptionCommandPayload(paramsAdd?: any, name?: string) {
|
|
800
|
-
return this.sessionDocumentCaptionCommandPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
public sessionToDocumentFree(paramsAdd?: any, name?: string) {
|
|
804
|
-
return this.sessionDocumentFree({ ...this.session.params, ...paramsAdd }, name)
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
// animation
|
|
808
|
-
|
|
809
|
-
public sessionToAnimationCaption(paramsAdd?: any, name?: string) {
|
|
810
|
-
return this.sessionAnimationCaption({ ...this.session.params, ...paramsAdd }, name)
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
public sessionToAnimationCaptionPayload(paramsAdd?: any, name?: string) {
|
|
814
|
-
return this.sessionAnimationCaptionPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
public sessionToAnimationCaptionCommand(paramsAdd?: any, name?: string) {
|
|
818
|
-
return this.sessionAnimationCaptionCommand({ ...this.session.params, ...paramsAdd }, name)
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
public sessionToAnimationCaptionCommandPayload(paramsAdd?: any, name?: string) {
|
|
822
|
-
return this.sessionAnimationCaptionCommandPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
public sessionToAnimationFree(paramsAdd?: any, name?: string) {
|
|
826
|
-
return this.sessionAnimationFree({ ...this.session.params, ...paramsAdd }, name)
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
// voice
|
|
830
|
-
|
|
831
|
-
public sessionToVoiceCaption(paramsAdd?: any, name?: string) {
|
|
832
|
-
return this.sessionVoiceCaption({ ...this.session.params, ...paramsAdd }, name)
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
public sessionToVoiceCaptionPayload(paramsAdd?: any, name?: string) {
|
|
836
|
-
return this.sessionVoiceCaptionPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
public sessionToVoiceCaptionCommand(paramsAdd?: any, name?: string) {
|
|
840
|
-
return this.sessionVoiceCaptionCommand({ ...this.session.params, ...paramsAdd }, name)
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
public sessionToVoiceCaptionCommandPayload(paramsAdd?: any, name?: string) {
|
|
844
|
-
return this.sessionVoiceCaptionCommandPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
public sessionToVoiceFree(paramsAdd?: any, name?: string) {
|
|
848
|
-
return this.sessionVoiceFree({ ...this.session.params, ...paramsAdd }, name)
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
// videonote
|
|
852
|
-
|
|
853
|
-
public sessionToVideoNoteCaption(paramsAdd?: any, name?: string) {
|
|
854
|
-
return this.sessionVideoNoteCaption({ ...this.session.params, ...paramsAdd }, name)
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
public sessionToVideoNoteCaptionPayload(paramsAdd?: any, name?: string) {
|
|
858
|
-
return this.sessionVideoNoteCaptionPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
public sessionToVideoNoteCaptionCommand(paramsAdd?: any, name?: string) {
|
|
862
|
-
return this.sessionVideoNoteCaptionCommand({ ...this.session.params, ...paramsAdd }, name)
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
public sessionToVideoNoteCaptionCommandPayload(paramsAdd?: any, name?: string) {
|
|
866
|
-
return this.sessionVideoNoteCaptionCommandPayload({ ...this.session.params, ...paramsAdd }, name)
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
public sessionToVideoNoteFree(paramsAdd?: any, name?: string) {
|
|
870
|
-
return this.sessionVideoNoteFree({ ...this.session.params, ...paramsAdd }, name)
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
// sticker
|
|
874
|
-
|
|
875
|
-
public sessionToStickerFree(paramsAdd?: any, name?: string) {
|
|
876
|
-
return this.sessionStickerFree({ ...this.session.params, ...paramsAdd }, name)
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
// location
|
|
880
|
-
|
|
881
|
-
public sessionToLocationFree(paramsAdd?: any, name?: string) {
|
|
882
|
-
return this.sessionLocationFree({ ...this.session.params, ...paramsAdd }, name)
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
// contact
|
|
886
|
-
|
|
887
|
-
public sessionToContactFree(paramsAdd?: any, name?: string) {
|
|
888
|
-
return this.sessionContactFree({ ...this.session.params, ...paramsAdd }, name)
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
// =============== build intent
|
|
892
|
-
|
|
893
|
-
public buildIntent(str?: string, fbCallbackData = true) {
|
|
894
|
-
if (!str) {
|
|
895
|
-
str = fbCallbackData ? this.data.callbackData() : this.data.name
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
const tag = fbCallbackData ? `:` : ` `
|
|
899
|
-
return str?.indexOf?.(tag) != -1 ? (str?.split?.(tag)?.[0] as string) : str
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
// =============== build session method
|
|
903
|
-
|
|
904
|
-
public buildSessionMethod(prefix: string, name: string | undefined) {
|
|
905
|
-
return `${prefix}-${name || this.data.name}`
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
// callback method
|
|
909
|
-
|
|
910
|
-
public buildSessionMethodCallback(name?: string) {
|
|
911
|
-
return this.buildSessionMethod(`1`, name)
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
public buildSessionMethodCallbackPayload(name?: string) {
|
|
915
|
-
return this.buildSessionMethod(`2`, name)
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
// text method
|
|
919
|
-
|
|
920
|
-
public buildSessionMethodText(name?: string) {
|
|
921
|
-
return this.buildSessionMethod(`3`, name)
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
public buildSessionMethodTextPayload(name?: string) {
|
|
925
|
-
return this.buildSessionMethod(`4`, name)
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
public buildSessionMethodTextCommand(name?: string) {
|
|
929
|
-
return this.buildSessionMethod(`5`, name)
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
public buildSessionMethodTextCommandPayload(name?: string) {
|
|
933
|
-
return this.buildSessionMethod(`6`, name)
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
public buildSessionMethodTextFree(name?: string) {
|
|
937
|
-
return this.buildSessionMethod(`7`, name)
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
// photo method
|
|
941
|
-
|
|
942
|
-
public buildSessionMethodPhotoCaption(name?: string) {
|
|
943
|
-
return this.buildSessionMethod(`8`, name)
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
public buildSessionMethodPhotoCaptionPayload(name?: string) {
|
|
947
|
-
return this.buildSessionMethod(`9`, name)
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
public buildSessionMethodPhotoCaptionCommand(name?: string) {
|
|
951
|
-
return this.buildSessionMethod(`10`, name)
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
public buildSessionMethodPhotoCaptionCommandPayload(name?: string) {
|
|
955
|
-
return this.buildSessionMethod(`11`, name)
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
public buildSessionMethodPhotoFree(name?: string) {
|
|
959
|
-
return this.buildSessionMethod(`12`, name)
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
// video method
|
|
963
|
-
|
|
964
|
-
public buildSessionMethodVideoCaption(name?: string) {
|
|
965
|
-
return this.buildSessionMethod(`13`, name)
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
public buildSessionMethodVideoCaptionPayload(name?: string) {
|
|
969
|
-
return this.buildSessionMethod(`14`, name)
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
public buildSessionMethodVideoCaptionCommand(name?: string) {
|
|
973
|
-
return this.buildSessionMethod(`15`, name)
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
public buildSessionMethodVideoCaptionCommandPayload(name?: string) {
|
|
977
|
-
return this.buildSessionMethod(`16`, name)
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
public buildSessionMethodVideoFree(name?: string) {
|
|
981
|
-
return this.buildSessionMethod(`17`, name)
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
// audio method
|
|
985
|
-
|
|
986
|
-
public buildSessionMethodAudioCaption(name?: string) {
|
|
987
|
-
return this.buildSessionMethod(`18`, name)
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
public buildSessionMethodAudioCaptionPayload(name?: string) {
|
|
991
|
-
return this.buildSessionMethod(`19`, name)
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
public buildSessionMethodAudioCaptionCommand(name?: string) {
|
|
995
|
-
return this.buildSessionMethod(`20`, name)
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
public buildSessionMethodAudioCaptionCommandPayload(name?: string) {
|
|
999
|
-
return this.buildSessionMethod(`21`, name)
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
public buildSessionMethodAudioFree(name?: string) {
|
|
1003
|
-
return this.buildSessionMethod(`22`, name)
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
// document method
|
|
1007
|
-
|
|
1008
|
-
public buildSessionMethodDocumentCaption(name?: string) {
|
|
1009
|
-
return this.buildSessionMethod(`23`, name)
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
public buildSessionMethodDocumentCaptionPayload(name?: string) {
|
|
1013
|
-
return this.buildSessionMethod(`24`, name)
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
public buildSessionMethodDocumentCaptionCommand(name?: string) {
|
|
1017
|
-
return this.buildSessionMethod(`25`, name)
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
public buildSessionMethodDocumentCaptionCommandPayload(name?: string) {
|
|
1021
|
-
return this.buildSessionMethod(`26`, name)
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
public buildSessionMethodDocumentFree(name?: string) {
|
|
1025
|
-
return this.buildSessionMethod(`27`, name)
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
// animation method
|
|
1029
|
-
|
|
1030
|
-
public buildSessionMethodAnimationCaption(name?: string) {
|
|
1031
|
-
return this.buildSessionMethod(`28`, name)
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
public buildSessionMethodAnimationCaptionPayload(name?: string) {
|
|
1035
|
-
return this.buildSessionMethod(`29`, name)
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
public buildSessionMethodAnimationCaptionCommand(name?: string) {
|
|
1039
|
-
return this.buildSessionMethod(`30`, name)
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
public buildSessionMethodAnimationCaptionCommandPayload(name?: string) {
|
|
1043
|
-
return this.buildSessionMethod(`31`, name)
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
public buildSessionMethodAnimationFree(name?: string) {
|
|
1047
|
-
return this.buildSessionMethod(`32`, name)
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
// voice method
|
|
1051
|
-
|
|
1052
|
-
public buildSessionMethodVoiceCaption(name?: string) {
|
|
1053
|
-
return this.buildSessionMethod(`33`, name)
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
public buildSessionMethodVoiceCaptionPayload(name?: string) {
|
|
1057
|
-
return this.buildSessionMethod(`34`, name)
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
public buildSessionMethodVoiceCaptionCommand(name?: string) {
|
|
1061
|
-
return this.buildSessionMethod(`35`, name)
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
public buildSessionMethodVoiceCaptionCommandPayload(name?: string) {
|
|
1065
|
-
return this.buildSessionMethod(`36`, name)
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
public buildSessionMethodVoiceFree(name?: string) {
|
|
1069
|
-
return this.buildSessionMethod(`37`, name)
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
// video note method
|
|
1073
|
-
|
|
1074
|
-
public buildSessionMethodVideoNoteCaption(name?: string) {
|
|
1075
|
-
return this.buildSessionMethod(`38`, name)
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
public buildSessionMethodVideoNoteCaptionPayload(name?: string) {
|
|
1079
|
-
return this.buildSessionMethod(`39`, name)
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
public buildSessionMethodVideoNoteCaptionCommand(name?: string) {
|
|
1083
|
-
return this.buildSessionMethod(`40`, name)
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
public buildSessionMethodVideoNoteCaptionCommandPayload(name?: string) {
|
|
1087
|
-
return this.buildSessionMethod(`41`, name)
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
public buildSessionMethodVideoNoteFree(name?: string) {
|
|
1091
|
-
return this.buildSessionMethod(`42`, name)
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
// sticker method
|
|
1095
|
-
|
|
1096
|
-
public buildSessionMethodStickerFree(name?: string) {
|
|
1097
|
-
return this.buildSessionMethod(`43`, name)
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
// location method
|
|
1101
|
-
|
|
1102
|
-
public buildSessionMethodLocationFree(name?: string) {
|
|
1103
|
-
return this.buildSessionMethod(`44`, name)
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
// contact method
|
|
1107
|
-
|
|
1108
|
-
public buildSessionMethodContactFree(name?: string) {
|
|
1109
|
-
return this.buildSessionMethod(`45`, name)
|
|
1110
|
-
}
|
|
1111
|
-
}
|