chz-telegram-bot 0.1.2 → 0.1.4
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/README.md +73 -11
- package/dist/dtos/incomingQuery.d.ts +9 -0
- package/dist/dtos/incomingQuery.d.ts.map +1 -0
- package/dist/dtos/incomingQuery.js +12 -0
- package/dist/dtos/responses/delay.d.ts +1 -1
- package/dist/dtos/responses/delay.d.ts.map +1 -1
- package/dist/dtos/responses/imageMessage.d.ts +1 -1
- package/dist/dtos/responses/imageMessage.d.ts.map +1 -1
- package/dist/dtos/responses/inlineQueryResponse.d.ts +13 -0
- package/dist/dtos/responses/inlineQueryResponse.d.ts.map +1 -0
- package/dist/dtos/responses/inlineQueryResponse.js +15 -0
- package/dist/dtos/responses/reaction.d.ts +1 -1
- package/dist/dtos/responses/reaction.d.ts.map +1 -1
- package/dist/dtos/responses/textMessage.d.ts +1 -1
- package/dist/dtos/responses/textMessage.d.ts.map +1 -1
- package/dist/dtos/responses/unpin.d.ts +1 -1
- package/dist/dtos/responses/unpin.d.ts.map +1 -1
- package/dist/dtos/responses/videoMessage.d.ts +1 -1
- package/dist/dtos/responses/videoMessage.d.ts.map +1 -1
- package/dist/entities/actions/commandAction.d.ts +1 -1
- package/dist/entities/actions/commandAction.d.ts.map +1 -1
- package/dist/entities/actions/inlineQueryAction.d.ts +14 -0
- package/dist/entities/actions/inlineQueryAction.d.ts.map +1 -0
- package/dist/entities/actions/inlineQueryAction.js +40 -0
- package/dist/entities/actions/scheduledAction.d.ts +1 -1
- package/dist/entities/actions/scheduledAction.d.ts.map +1 -1
- package/dist/entities/botInstance.d.ts +8 -2
- package/dist/entities/botInstance.d.ts.map +1 -1
- package/dist/entities/botInstance.js +34 -2
- package/dist/entities/context/chatContext.d.ts +1 -1
- package/dist/entities/context/chatContext.d.ts.map +1 -1
- package/dist/entities/context/inlineQueryContext.d.ts +38 -0
- package/dist/entities/context/inlineQueryContext.d.ts.map +1 -0
- package/dist/entities/context/inlineQueryContext.js +40 -0
- package/dist/entities/context/messageContext.d.ts +1 -1
- package/dist/entities/context/messageContext.d.ts.map +1 -1
- package/dist/helpers/builders/inlineQueryActionBuilder.d.ts +34 -0
- package/dist/helpers/builders/inlineQueryActionBuilder.d.ts.map +1 -0
- package/dist/helpers/builders/inlineQueryActionBuilder.js +48 -0
- package/dist/helpers/noop.d.ts +1 -0
- package/dist/helpers/noop.d.ts.map +1 -1
- package/dist/helpers/noop.js +1 -1
- package/dist/helpers/traceFactory.d.ts +1 -1
- package/dist/helpers/traceFactory.d.ts.map +1 -1
- package/dist/helpers/traceFactory.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/main.d.ts +44 -35
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +34 -31
- package/dist/services/jsonFileStorage.d.ts +1 -1
- package/dist/services/jsonFileStorage.d.ts.map +1 -1
- package/dist/services/telegramApi.d.ts.map +1 -1
- package/dist/services/telegramApi.js +6 -1
- package/dist/types/handlers.d.ts +4 -0
- package/dist/types/handlers.d.ts.map +1 -1
- package/dist/types/response.d.ts +4 -2
- package/dist/types/response.d.ts.map +1 -1
- package/dist/types/response.js +2 -1
- package/dist/types/statefulAction.d.ts +9 -0
- package/dist/types/statefulAction.d.ts.map +1 -0
- package/dist/types/statefulAction.js +2 -0
- package/dist/types/statelessAction.d.ts +5 -0
- package/dist/types/statelessAction.d.ts.map +1 -0
- package/dist/types/statelessAction.js +2 -0
- package/dist/types/storage.d.ts +1 -1
- package/dist/types/storage.d.ts.map +1 -1
- package/dtos/incomingQuery.ts +20 -0
- package/dtos/responses/delay.ts +1 -1
- package/dtos/responses/imageMessage.ts +1 -1
- package/dtos/responses/inlineQueryResponse.ts +26 -0
- package/dtos/responses/reaction.ts +1 -1
- package/dtos/responses/textMessage.ts +1 -1
- package/dtos/responses/unpin.ts +1 -1
- package/dtos/responses/videoMessage.ts +1 -1
- package/entities/actions/commandAction.ts +1 -1
- package/entities/actions/inlineQueryAction.ts +68 -0
- package/entities/actions/scheduledAction.ts +1 -1
- package/entities/botInstance.ts +86 -4
- package/entities/context/chatContext.ts +4 -4
- package/entities/context/inlineQueryContext.ts +83 -0
- package/entities/context/messageContext.ts +1 -1
- package/helpers/builders/inlineQueryActionBuilder.ts +62 -0
- package/helpers/noop.ts +3 -1
- package/helpers/traceFactory.ts +4 -2
- package/index.ts +1 -1
- package/main.ts +65 -58
- package/package.json +1 -1
- package/services/jsonFileStorage.ts +1 -1
- package/services/telegramApi.ts +10 -1
- package/types/handlers.ts +6 -0
- package/types/response.ts +5 -2
- package/types/statelessAction.ts +5 -0
- package/types/storage.ts +1 -1
- /package/types/{actionWithState.ts → statefulAction.ts} +0 -0
package/README.md
CHANGED
|
@@ -4,14 +4,35 @@
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
botFramework is a TypeScript library that provides a structured approach to building Telegram bots. It
|
|
7
|
+
botFramework is a TypeScript library that provides a structured approach to building Telegram bots. It offers a comprehensive set of features for managing bot lifecycles, message processing, scheduled tasks, and state persistence, built on top of the popular Telegraf library.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Type-Safe Command Building**: Fully TypeScript-supported command builders
|
|
12
|
+
- **Stateful Actions**: Built-in state management for commands, scheduled actions, and inline queries
|
|
13
|
+
- **Flexible Triggering**: Support for exact matches, regex patterns, and message types
|
|
14
|
+
- **Scheduled Tasks**: Time-based actions with customizable execution schedules
|
|
15
|
+
- **Access Control**: Built-in user and chat-based permissions
|
|
16
|
+
- **Cooldown Management**: Configurable cooldown periods for commands
|
|
17
|
+
- **Cached Values**: Process-wide caching system for optimizing resource usage
|
|
18
|
+
- **Custom State Types**: Extensible state system for complex bot logic
|
|
19
|
+
- **Comprehensive Logging**: Built-in logging system with trace IDs
|
|
20
|
+
- **Persistent Storage**: JSON-based file storage with automatic state management
|
|
21
|
+
- **Inline Query Support**: Handle inline queries with type-safe builders
|
|
22
|
+
- **Response Queue**: Managed response processing queue for reliable message delivery
|
|
23
|
+
- **Rich Media Support**: Built-in support for text, images, videos, reactions, and inline results
|
|
8
24
|
|
|
9
25
|
## Installation
|
|
10
26
|
|
|
11
|
-
```
|
|
27
|
+
```bash
|
|
28
|
+
# Using npm
|
|
12
29
|
npm install chz-bot-framework
|
|
13
|
-
|
|
14
|
-
|
|
30
|
+
|
|
31
|
+
# Using yarn
|
|
32
|
+
yarn add chz-bot-framework
|
|
33
|
+
|
|
34
|
+
# Using bun
|
|
35
|
+
bun add chz-bot-framework
|
|
15
36
|
```
|
|
16
37
|
|
|
17
38
|
## Quick Start
|
|
@@ -161,19 +182,27 @@ When starting a bot, you can provide the following configuration:
|
|
|
161
182
|
| ----------------- | ------------------------ | --------------------------- | ----------------------------------------------------------------------------------------- |
|
|
162
183
|
| `name` | `string` | Yes | Bot name used in logging |
|
|
163
184
|
| `tokenFilePath` | `string` | Yes | Path to file containing Telegram Bot token |
|
|
164
|
-
| `
|
|
165
|
-
| `scheduled` | `ScheduledAction[]` | Yes (can be empty) | Collection of scheduled actions |
|
|
185
|
+
| `actions` | | Yes | Object containing actions to be executed by bot |
|
|
166
186
|
| `chats` | `Record<string, number>` | Yes | Object containing chat name-id pairs. Used for logging and execution of scheduled action. |
|
|
167
187
|
| `storagePath` | `string` | No | Custom storage path for default JsonFileStorage client |
|
|
168
188
|
| `scheduledPeriod` | `Seconds` | No (will default to 1 hour) | Period between scheduled action executions |
|
|
169
189
|
| `services` | | No | Custom services to be used instead of default ones |
|
|
170
190
|
|
|
191
|
+
Actions object should have following structure:
|
|
192
|
+
|
|
193
|
+
| Option | Type | Required | Description |
|
|
194
|
+
| --------------- | --------------------- | ------------------ | ---------------------------------- |
|
|
195
|
+
| `commands` | `CommandAction[] ` | Yes (can be empty) | Collection of command actions |
|
|
196
|
+
| `scheduled` | `ScheduledAction[]` | Yes (can be empty) | Collection of scheduled actions |
|
|
197
|
+
| `inlineQueries` | `InlineQueryAction[]` | Yes (can be empty) | Collection of inline query actions |
|
|
198
|
+
|
|
171
199
|
Services object should have following structure:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
200
|
+
|
|
201
|
+
| Option | Type | Required | Description |
|
|
202
|
+
| --------------- | ---------------- | ------------------------------------------- | ---------------------------------- |
|
|
203
|
+
| `storageClient` | `IStorageClient` | No (will default to `JsonFileStorage`) | Persistance state provide |
|
|
204
|
+
| `logger` | `ILogger` | No (will default to `JsonLogger`) | Logger service |
|
|
205
|
+
| `scheduler` | `IScheduler` | No (will default to `NodeTimeoutScheduler`) | Scheduler used to scheduled action |
|
|
177
206
|
|
|
178
207
|
## Advanced Usage
|
|
179
208
|
|
|
@@ -202,6 +231,39 @@ const counterCommand = new CommandActionBuilderWithState<MyCustomState>(
|
|
|
202
231
|
|
|
203
232
|
State is mutable and all changes to it will be saved after execution of action is finished.
|
|
204
233
|
|
|
234
|
+
### Inline Queries
|
|
235
|
+
|
|
236
|
+
The framework provides support for handling inline queries with type-safe builders:
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
import { InlineQueryActionBuilder } from 'chz-telegram-bot';
|
|
240
|
+
|
|
241
|
+
const searchCommand = new InlineQueryActionBuilder('Search')
|
|
242
|
+
.do(async (ctx) => {
|
|
243
|
+
const query = ctx.queryText;
|
|
244
|
+
// Process the query and return inline results
|
|
245
|
+
ctx.showInlineQueryResult({
|
|
246
|
+
id: '1',
|
|
247
|
+
type: 'article',
|
|
248
|
+
title: `Search results for: ${query}`,
|
|
249
|
+
description: 'Click to send'
|
|
250
|
+
});
|
|
251
|
+
})
|
|
252
|
+
.build();
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Response Queue
|
|
256
|
+
|
|
257
|
+
The framework includes a response processing queue that ensures reliable message delivery and proper ordering of responses:
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
ctx.sendTextToChat('First message');
|
|
261
|
+
ctx.sendImageToChat('image.jpg');
|
|
262
|
+
ctx.react('👍');
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
All responses are queued and processed in order, ensuring proper sequencing of messages and reactions.
|
|
266
|
+
|
|
205
267
|
## Stopping the Bot
|
|
206
268
|
|
|
207
269
|
To properly terminate your bot and clean up resources:
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TraceId } from '../types/trace';
|
|
2
|
+
export declare class IncomingInlineQuery {
|
|
3
|
+
readonly queryId: string;
|
|
4
|
+
readonly query: string;
|
|
5
|
+
readonly userId: number;
|
|
6
|
+
readonly traceId: TraceId;
|
|
7
|
+
constructor(queryId: string, query: string, userId: number, traceId: TraceId);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=incomingQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incomingQuery.d.ts","sourceRoot":"","sources":["../../dtos/incomingQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,qBAAa,mBAAmB;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;gBAGtB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO;CAOvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IncomingInlineQuery = void 0;
|
|
4
|
+
class IncomingInlineQuery {
|
|
5
|
+
constructor(queryId, query, userId, traceId) {
|
|
6
|
+
this.queryId = queryId;
|
|
7
|
+
this.query = query;
|
|
8
|
+
this.userId = userId;
|
|
9
|
+
this.traceId = traceId;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.IncomingInlineQuery = IncomingInlineQuery;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IActionState } from '../../types/actionState';
|
|
2
|
-
import { IActionWithState } from '../../types/
|
|
2
|
+
import { IActionWithState } from '../../types/statefulAction';
|
|
3
3
|
import { IChatResponse } from '../../types/response';
|
|
4
4
|
import { Milliseconds } from '../../types/timeValues';
|
|
5
5
|
import { TraceId } from '../../types/trace';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../dtos/responses/delay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../dtos/responses/delay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,aAAc,YAAW,aAAa;IAC/C,QAAQ,CAAC,IAAI,UAA0B;IACvC,QAAQ,CAAC,SAAS,SAAc;IAEhC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAG5C,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC;CAO7C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputFile } from 'telegraf/types';
|
|
2
2
|
import { IReplyMessage } from '../../types/response';
|
|
3
3
|
import { MessageSendingOptions } from '../../types/messageSendingOptions';
|
|
4
|
-
import { IActionWithState } from '../../types/
|
|
4
|
+
import { IActionWithState } from '../../types/statefulAction';
|
|
5
5
|
import { IActionState } from '../../types/actionState';
|
|
6
6
|
import { ChatInfo } from '../chatInfo';
|
|
7
7
|
import { TraceId } from '../../types/trace';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageMessage.d.ts","sourceRoot":"","sources":["../../../dtos/responses/imageMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"imageMessage.d.ts","sourceRoot":"","sources":["../../../dtos/responses/imageMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,qBAAa,YAAa,YAAW,aAAa,CAAC,SAAS,CAAC;IACzD,QAAQ,CAAC,IAAI,UAA0B;IACvC,QAAQ,CAAC,SAAS,SAAc;IAEhC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,SAAS;IACnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAG5C,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACtC,OAAO,CAAC,EAAE,qBAAqB;CAStC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InlineQueryResult } from 'telegraf/types';
|
|
2
|
+
import { InlineQueryAction } from '../../entities/actions/inlineQueryAction';
|
|
3
|
+
import { TraceId } from '../../types/trace';
|
|
4
|
+
export declare class InlineQueryResponse {
|
|
5
|
+
readonly kind: "inlineQuery";
|
|
6
|
+
readonly createdAt: number;
|
|
7
|
+
readonly queryId: string;
|
|
8
|
+
readonly traceId: TraceId;
|
|
9
|
+
readonly action: InlineQueryAction;
|
|
10
|
+
readonly queryResults: InlineQueryResult[];
|
|
11
|
+
constructor(queryResult: InlineQueryResult[], queryId: string, traceId: TraceId, action: InlineQueryAction);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=inlineQueryResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inlineQueryResponse.d.ts","sourceRoot":"","sources":["../../../dtos/responses/inlineQueryResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,qBAAa,mBAAmB;IAC5B,QAAQ,CAAC,IAAI,gBAAgC;IAC7C,QAAQ,CAAC,SAAS,SAAc;IAEhC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,iBAAiB,EAAE,CAAC;gBAGvC,WAAW,EAAE,iBAAiB,EAAE,EAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,iBAAiB;CAOhC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InlineQueryResponse = void 0;
|
|
4
|
+
const response_1 = require("../../types/response");
|
|
5
|
+
class InlineQueryResponse {
|
|
6
|
+
constructor(queryResult, queryId, traceId, action) {
|
|
7
|
+
this.kind = response_1.BotResponseTypes.inlineQuery;
|
|
8
|
+
this.createdAt = Date.now();
|
|
9
|
+
this.queryResults = queryResult;
|
|
10
|
+
this.queryId = queryId;
|
|
11
|
+
this.traceId = traceId;
|
|
12
|
+
this.action = action;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.InlineQueryResponse = InlineQueryResponse;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TelegramEmoji } from 'telegraf/types';
|
|
2
2
|
import { IChatResponse } from '../../types/response';
|
|
3
|
-
import { IActionWithState } from '../../types/
|
|
3
|
+
import { IActionWithState } from '../../types/statefulAction';
|
|
4
4
|
import { IActionState } from '../../types/actionState';
|
|
5
5
|
import { ChatInfo } from '../chatInfo';
|
|
6
6
|
import { TraceId } from '../../types/trace';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reaction.d.ts","sourceRoot":"","sources":["../../../dtos/responses/reaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"reaction.d.ts","sourceRoot":"","sources":["../../../dtos/responses/reaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,qBAAa,QAAS,YAAW,aAAa;IAC1C,QAAQ,CAAC,IAAI,UAA0B;IACvC,QAAQ,CAAC,SAAS,SAAc;IAEhC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAG5C,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC;CAQ7C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextMessageSendingOptions } from '../../types/messageSendingOptions';
|
|
2
2
|
import { IReplyMessage } from '../../types/response';
|
|
3
|
-
import { IActionWithState } from '../../types/
|
|
3
|
+
import { IActionWithState } from '../../types/statefulAction';
|
|
4
4
|
import { IActionState } from '../../types/actionState';
|
|
5
5
|
import { ChatInfo } from '../chatInfo';
|
|
6
6
|
import { TraceId } from '../../types/trace';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textMessage.d.ts","sourceRoot":"","sources":["../../../dtos/responses/textMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"textMessage.d.ts","sourceRoot":"","sources":["../../../dtos/responses/textMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,qBAAa,WAAY,YAAW,aAAa,CAAC,MAAM,CAAC;IACrD,QAAQ,CAAC,IAAI,SAAyB;IACtC,QAAQ,CAAC,SAAS,SAAc;IAEhC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAG5C,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACtC,OAAO,CAAC,EAAE,yBAAyB;CAU1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IChatResponse } from '../../types/response';
|
|
2
|
-
import { IActionWithState } from '../../types/
|
|
2
|
+
import { IActionWithState } from '../../types/statefulAction';
|
|
3
3
|
import { IActionState } from '../../types/actionState';
|
|
4
4
|
import { ChatInfo } from '../chatInfo';
|
|
5
5
|
import { TraceId } from '../../types/trace';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unpin.d.ts","sourceRoot":"","sources":["../../../dtos/responses/unpin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"unpin.d.ts","sourceRoot":"","sources":["../../../dtos/responses/unpin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,qBAAa,aAAc,YAAW,aAAa;IAC/C,QAAQ,CAAC,IAAI,UAA0B;IACvC,QAAQ,CAAC,SAAS,SAAc;IAEhC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAG5C,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC;CAO7C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputFile } from 'telegraf/types';
|
|
2
2
|
import { IReplyMessage } from '../../types/response';
|
|
3
3
|
import { MessageSendingOptions } from '../../types/messageSendingOptions';
|
|
4
|
-
import { IActionWithState } from '../../types/
|
|
4
|
+
import { IActionWithState } from '../../types/statefulAction';
|
|
5
5
|
import { IActionState } from '../../types/actionState';
|
|
6
6
|
import { ChatInfo } from '../chatInfo';
|
|
7
7
|
import { TraceId } from '../../types/trace';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoMessage.d.ts","sourceRoot":"","sources":["../../../dtos/responses/videoMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"videoMessage.d.ts","sourceRoot":"","sources":["../../../dtos/responses/videoMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,qBAAa,YAAa,YAAW,aAAa,CAAC,SAAS,CAAC;IACzD,QAAQ,CAAC,IAAI,UAA0B;IACvC,QAAQ,CAAC,SAAS,SAAc;IAEhC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,SAAS;IACnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBAG5C,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACtC,OAAO,CAAC,EAAE,qBAAqB;CAStC"}
|
|
@@ -2,7 +2,7 @@ import { CommandHandler } from '../../types/handlers';
|
|
|
2
2
|
import { CommandCondition } from '../../types/commandCondition';
|
|
3
3
|
import { Seconds } from '../../types/timeValues';
|
|
4
4
|
import { IActionState } from '../../types/actionState';
|
|
5
|
-
import { IActionWithState, ActionKey } from '../../types/
|
|
5
|
+
import { IActionWithState, ActionKey } from '../../types/statefulAction';
|
|
6
6
|
import { MessageContext } from '../context/messageContext';
|
|
7
7
|
import { CommandTrigger } from '../../types/commandTrigger';
|
|
8
8
|
export declare class CommandAction<TActionState extends IActionState> implements IActionWithState<TActionState> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandAction.d.ts","sourceRoot":"","sources":["../../../entities/actions/commandAction.ts"],"names":[],"mappings":"AACA,O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AE,MAAM,YAAY,CAAC;IAC9C,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;gBAGpB,OAAO,EAAE,cAAc,GAAG,cAAc,EAAE,EAC1C,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,EACrC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,OAAO,EACjB,cAAc,EAAE,MAAM,EAAE,EACxB,YAAY,EAAE,MAAM,EAAE,EACtB,SAAS,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACzC,gBAAgB,EAAE,MAAM,YAAY;IAelC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,YAAY,CAAC;IAkD5C,OAAO,CAAC,uBAAuB;IAqC/B,OAAO,CAAC,YAAY;CAmCvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ActionKey } from '../../types/statefulAction';
|
|
2
|
+
import { InlineQueryContext } from '../context/inlineQueryContext';
|
|
3
|
+
import { InlineQueryHandler } from '../../types/handlers';
|
|
4
|
+
import { IActionWithoutState } from '../../types/statelessAction';
|
|
5
|
+
export declare class InlineQueryAction implements IActionWithoutState {
|
|
6
|
+
readonly key: ActionKey;
|
|
7
|
+
readonly active: boolean;
|
|
8
|
+
readonly handler: InlineQueryHandler;
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly pattern: RegExp;
|
|
11
|
+
constructor(handler: InlineQueryHandler, name: string, active: boolean, pattern: RegExp);
|
|
12
|
+
exec(ctx: InlineQueryContext): Promise<import("../../types/response").BotResponse[]>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=inlineQueryAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inlineQueryAction.d.ts","sourceRoot":"","sources":["../../../entities/actions/inlineQueryAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,qBAAa,iBAAkB,YAAW,mBAAmB;IACzD,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAGrB,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM;IAUb,IAAI,CAAC,GAAG,EAAE,kBAAkB;CAwCrC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InlineQueryAction = void 0;
|
|
4
|
+
const noop_1 = require("../../helpers/noop");
|
|
5
|
+
class InlineQueryAction {
|
|
6
|
+
constructor(handler, name, active, pattern) {
|
|
7
|
+
this.handler = handler;
|
|
8
|
+
this.name = name;
|
|
9
|
+
this.active = active;
|
|
10
|
+
this.pattern = pattern;
|
|
11
|
+
this.key = `inline:${this.name.replace('.', '-')}`;
|
|
12
|
+
}
|
|
13
|
+
async exec(ctx) {
|
|
14
|
+
if (!ctx.isInitialized)
|
|
15
|
+
throw new Error(`Context for ${this.key} is not initialized or already consumed`);
|
|
16
|
+
if (!this.active)
|
|
17
|
+
return noop_1.Noop.NoResponse;
|
|
18
|
+
const matchResults = [];
|
|
19
|
+
this.pattern.lastIndex = 0;
|
|
20
|
+
const execResult = this.pattern.exec(ctx.queryText);
|
|
21
|
+
if (execResult != null) {
|
|
22
|
+
matchResults.push(execResult);
|
|
23
|
+
if (this.pattern.global) {
|
|
24
|
+
while (true) {
|
|
25
|
+
const nextResult = this.pattern.exec(ctx.queryText);
|
|
26
|
+
if (nextResult == null)
|
|
27
|
+
break;
|
|
28
|
+
matchResults.push(nextResult);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (matchResults.length == 0)
|
|
33
|
+
return noop_1.Noop.NoResponse;
|
|
34
|
+
ctx.matchResults = matchResults;
|
|
35
|
+
ctx.logger.logWithTraceId(ctx.botName, ctx.traceId, 'Unknown', ` - Executing [${this.name}]`);
|
|
36
|
+
await this.handler(ctx);
|
|
37
|
+
return ctx.responses;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.InlineQueryAction = InlineQueryAction;
|
|
@@ -2,7 +2,7 @@ import { Sema as Semaphore } from 'async-sema';
|
|
|
2
2
|
import { ScheduledHandler } from '../../types/handlers';
|
|
3
3
|
import { HoursOfDay } from '../../types/timeValues';
|
|
4
4
|
import { IActionState } from '../../types/actionState';
|
|
5
|
-
import { IActionWithState, ActionKey } from '../../types/
|
|
5
|
+
import { IActionWithState, ActionKey } from '../../types/statefulAction';
|
|
6
6
|
import { CachedStateFactory } from '../cachedStateFactory';
|
|
7
7
|
import { ChatContext } from '../context/chatContext';
|
|
8
8
|
export declare class ScheduledAction<TActionState extends IActionState> implements IActionWithState<TActionState> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduledAction.d.ts","sourceRoot":"","sources":["../../../entities/actions/scheduledAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"scheduledAction.d.ts","sourceRoot":"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EAAE,MAAM,YAAY;IAYlC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,YAAY,CAAC;YA0C3B,cAAc;IA+C5B,OAAO,CAAC,uBAAuB;CAalC"}
|
|
@@ -5,6 +5,7 @@ import { CommandAction } from './actions/commandAction';
|
|
|
5
5
|
import { ScheduledAction } from './actions/scheduledAction';
|
|
6
6
|
import { ILogger } from '../types/logger';
|
|
7
7
|
import { IScheduler } from '../types/scheduler';
|
|
8
|
+
import { InlineQueryAction } from './actions/inlineQueryAction';
|
|
8
9
|
export declare class BotInstance {
|
|
9
10
|
private readonly api;
|
|
10
11
|
private readonly storage;
|
|
@@ -14,12 +15,16 @@ export declare class BotInstance {
|
|
|
14
15
|
private readonly telegraf;
|
|
15
16
|
private readonly commands;
|
|
16
17
|
private readonly scheduled;
|
|
18
|
+
private readonly inlineQueries;
|
|
17
19
|
private readonly chats;
|
|
18
20
|
constructor(options: {
|
|
19
21
|
name: string;
|
|
20
22
|
token: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
actions: {
|
|
24
|
+
commands: CommandAction<IActionState>[];
|
|
25
|
+
scheduled: ScheduledAction<IActionState>[];
|
|
26
|
+
inlineQueries: InlineQueryAction[];
|
|
27
|
+
};
|
|
23
28
|
chats: Record<string, number>;
|
|
24
29
|
storagePath?: string;
|
|
25
30
|
scheduledPeriod?: Seconds;
|
|
@@ -31,6 +36,7 @@ export declare class BotInstance {
|
|
|
31
36
|
};
|
|
32
37
|
});
|
|
33
38
|
private initializeScheduledProcessing;
|
|
39
|
+
private initializeInlineQueryProcessing;
|
|
34
40
|
private initializeMessageProcessing;
|
|
35
41
|
stop(code: string): Promise<void>;
|
|
36
42
|
private runScheduled;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"botInstance.d.ts","sourceRoot":"","sources":["../../entities/botInstance.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,cAA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,KAAK,CAAyB;gBAEnC,OAAO,EAAE;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE;YACL,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE,CAAC;YACxC,SAAS,EAAE,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC;YAC3C,aAAa,EAAE,iBAAiB,EAAE,CAAC;SACtC,CAAC;QACF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,gCAAgC,CAAC,EAAE,OAAO,CAAC;QAC3C,QAAQ,CAAC,EAAE;YACP,aAAa,CAAC,EAAE,cAAc,CAAC;YAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;YACjB,SAAS,CAAC,EAAE,UAAU,CAAC;SAC1B,CAAC;KACL;IA0CD,OAAO,CAAC,6BAA6B;IA4CrC,OAAO,CAAC,+BAA+B;IAwEvC,OAAO,CAAC,2BAA2B;IAiC7B,IAAI,CAAC,IAAI,EAAE,MAAM;YAaT,YAAY;YAuCZ,cAAc;CA2B/B"}
|
|
@@ -16,11 +16,14 @@ const messageContext_1 = require("./context/messageContext");
|
|
|
16
16
|
const chatInfo_1 = require("../dtos/chatInfo");
|
|
17
17
|
const nodeTimeoutScheduler_1 = require("../services/nodeTimeoutScheduler");
|
|
18
18
|
const traceFactory_1 = require("../helpers/traceFactory");
|
|
19
|
+
const incomingQuery_1 = require("../dtos/incomingQuery");
|
|
20
|
+
const inlineQueryContext_1 = require("./context/inlineQueryContext");
|
|
19
21
|
class BotInstance {
|
|
20
22
|
constructor(options) {
|
|
21
23
|
this.name = options.name;
|
|
22
|
-
this.commands = options.commands;
|
|
23
|
-
this.scheduled = options.scheduled;
|
|
24
|
+
this.commands = options.actions.commands;
|
|
25
|
+
this.scheduled = options.actions.scheduled;
|
|
26
|
+
this.inlineQueries = options.actions.inlineQueries;
|
|
24
27
|
this.chats = options.chats;
|
|
25
28
|
const actions = [...this.commands, ...this.scheduled];
|
|
26
29
|
this.telegraf = new telegraf_1.Telegraf(options.token);
|
|
@@ -33,6 +36,7 @@ class BotInstance {
|
|
|
33
36
|
new jsonFileStorage_1.JsonFileStorage(options.name, actions, options.storagePath);
|
|
34
37
|
this.api = new telegramApi_1.TelegramApiService(this.name, this.telegraf.telegram, this.storage, this.logger);
|
|
35
38
|
this.initializeMessageProcessing(options.verboseLoggingForIncomingMessage ?? false);
|
|
39
|
+
this.initializeInlineQueryProcessing(500);
|
|
36
40
|
this.initializeScheduledProcessing(options.scheduledPeriod ?? (0, timeConvertions_1.hoursToSeconds)(1));
|
|
37
41
|
this.storage.saveMetadata(actions, this.name);
|
|
38
42
|
this.logger.logWithTraceId(this.name, (0, traceFactory_1.createTrace)(this, this.name, 'Start'), 'System', 'Starting bot...');
|
|
@@ -59,6 +63,34 @@ class BotInstance {
|
|
|
59
63
|
}, delay, this.name);
|
|
60
64
|
}
|
|
61
65
|
}
|
|
66
|
+
initializeInlineQueryProcessing(period) {
|
|
67
|
+
let pendingInlineQueries = [];
|
|
68
|
+
if (this.inlineQueries.length > 0) {
|
|
69
|
+
this.telegraf.on('inline_query', async (ctx) => {
|
|
70
|
+
const query = new incomingQuery_1.IncomingInlineQuery(ctx.inlineQuery.id, ctx.inlineQuery.query, ctx.inlineQuery.from.id, (0, traceFactory_1.createTrace)('InlineQuery', this.name, ctx.inlineQuery.id));
|
|
71
|
+
this.logger.logWithTraceId(this.name, query.traceId, 'Query', `${ctx.inlineQuery.from.username} (${ctx.inlineQuery.from.id}): Query for ${ctx.inlineQuery.query}`);
|
|
72
|
+
pendingInlineQueries = pendingInlineQueries.filter((q) => q.userId != query.userId);
|
|
73
|
+
pendingInlineQueries.push(query);
|
|
74
|
+
});
|
|
75
|
+
this.scheduler.createTask('InlineQueryProcessing', async () => {
|
|
76
|
+
const ctx = new inlineQueryContext_1.InlineQueryContext(this.storage, this.logger, this.scheduler);
|
|
77
|
+
for (const inlineQuery of pendingInlineQueries) {
|
|
78
|
+
for (const inlineQueryAction of this.inlineQueries) {
|
|
79
|
+
ctx.initializeContext(inlineQuery.query, inlineQuery.queryId, this.name, inlineQueryAction, inlineQuery.traceId);
|
|
80
|
+
try {
|
|
81
|
+
const responses = await inlineQueryAction.exec(ctx);
|
|
82
|
+
this.api.enqueueBatchedResponses(responses);
|
|
83
|
+
ctx.isInitialized = false;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
this.logger.errorWithTraceId(ctx.botName, ctx.traceId, 'Unknown', error, ctx);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
this.api.flushResponses();
|
|
91
|
+
}, period, false, this.name);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
62
94
|
initializeMessageProcessing(verboseLoggingForIncomingMessage) {
|
|
63
95
|
if (this.commands.length > 0) {
|
|
64
96
|
this.telegraf.on('message', async (ctx) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IStorageClient } from '../../types/storage';
|
|
2
2
|
import { MessageSendingOptions, TextMessageSendingOptions } from '../../types/messageSendingOptions';
|
|
3
|
-
import { IActionWithState } from '../../types/
|
|
3
|
+
import { IActionWithState } from '../../types/statefulAction';
|
|
4
4
|
import { IActionState } from '../../types/actionState';
|
|
5
5
|
import { BotResponse } from '../../types/response';
|
|
6
6
|
import { Milliseconds } from '../../types/timeValues';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatContext.d.ts","sourceRoot":"","sources":["../../../entities/context/chatContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"chatContext.d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YAAY,CAAC,EACtC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO;IAapB;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,yBAAyB;IAahE;;;;;OAKG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAc7D;;;;;OAKG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAc7D;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM;IAW9B;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,YAAY;CAK3B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { InlineQueryResult } from 'telegraf/types';
|
|
2
|
+
import { ILogger } from '../../types/logger';
|
|
3
|
+
import { BotResponse } from '../../types/response';
|
|
4
|
+
import { IScheduler } from '../../types/scheduler';
|
|
5
|
+
import { IStorageClient } from '../../types/storage';
|
|
6
|
+
import { TraceId } from '../../types/trace';
|
|
7
|
+
import { InlineQueryAction } from '../actions/inlineQueryAction';
|
|
8
|
+
export declare class InlineQueryContext {
|
|
9
|
+
private action;
|
|
10
|
+
private queryResults;
|
|
11
|
+
/** Storage client instance for the bot executing this action. */
|
|
12
|
+
readonly storage: IStorageClient;
|
|
13
|
+
/** Logger instance for the bot executing this action */
|
|
14
|
+
readonly logger: ILogger;
|
|
15
|
+
/** Scheduler instance for the bot executing this action */
|
|
16
|
+
readonly scheduler: IScheduler;
|
|
17
|
+
/** Trace id of a action execution. */
|
|
18
|
+
traceId: TraceId;
|
|
19
|
+
/** Name of a bot that executes this action. */
|
|
20
|
+
botName: string;
|
|
21
|
+
/** Ordered collection of responses to be processed */
|
|
22
|
+
get responses(): BotResponse[];
|
|
23
|
+
/** Inline query text */
|
|
24
|
+
queryText: string;
|
|
25
|
+
/** Internal query id */
|
|
26
|
+
queryId: string;
|
|
27
|
+
/** Collection of Regexp match results on a message that triggered this action. Will be empty if trigger is not a Regexp. */
|
|
28
|
+
matchResults: RegExpMatchArray[];
|
|
29
|
+
isInitialized: boolean;
|
|
30
|
+
constructor(storage: IStorageClient, logger: ILogger, scheduler: IScheduler);
|
|
31
|
+
initializeContext(queryText: string, queryId: string, botName: string, action: InlineQueryAction, traceId: TraceId): this;
|
|
32
|
+
/**
|
|
33
|
+
* This result will be shown to user as a response to inline query.
|
|
34
|
+
* @param queryResult Inline query result to be shown to user.
|
|
35
|
+
*/
|
|
36
|
+
showInlineQueryResult(queryResult: InlineQueryResult): void;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=inlineQueryContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inlineQueryContext.d.ts","sourceRoot":"","sources":["../../../entities/context/inlineQueryContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,YAAY,CAA2B;IAE/C,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,wDAAwD;IACxD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAE/B,sCAAsC;IACtC,OAAO,EAAG,OAAO,CAAC;IAClB,+CAA+C;IAC/C,OAAO,EAAG,MAAM,CAAC;IAEjB,uDAAuD;IACvD,IAAI,SAAS,IAAI,WAAW,EAAE,CAS7B;IACD,wBAAwB;IACxB,SAAS,EAAG,MAAM,CAAC;IACnB,wBAAwB;IACxB,OAAO,EAAG,MAAM,CAAC;IACjB,4HAA4H;IAC5H,YAAY,EAAE,gBAAgB,EAAE,CAAM;IAEtC,aAAa,UAAS;gBAGlB,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,UAAU;IAOzB,iBAAiB,CACb,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,OAAO;IAepB;;;OAGG;IACH,qBAAqB,CAAC,WAAW,EAAE,iBAAiB;CAGvD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InlineQueryContext = void 0;
|
|
4
|
+
const inlineQueryResponse_1 = require("../../dtos/responses/inlineQueryResponse");
|
|
5
|
+
class InlineQueryContext {
|
|
6
|
+
/** Ordered collection of responses to be processed */
|
|
7
|
+
get responses() {
|
|
8
|
+
return [
|
|
9
|
+
new inlineQueryResponse_1.InlineQueryResponse(this.queryResults, this.queryId, this.traceId, this.action)
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
constructor(storage, logger, scheduler) {
|
|
13
|
+
this.queryResults = [];
|
|
14
|
+
/** Collection of Regexp match results on a message that triggered this action. Will be empty if trigger is not a Regexp. */
|
|
15
|
+
this.matchResults = [];
|
|
16
|
+
this.isInitialized = false;
|
|
17
|
+
this.storage = storage;
|
|
18
|
+
this.logger = logger;
|
|
19
|
+
this.scheduler = scheduler;
|
|
20
|
+
}
|
|
21
|
+
initializeContext(queryText, queryId, botName, action, traceId) {
|
|
22
|
+
this.queryText = queryText;
|
|
23
|
+
this.queryId = queryId;
|
|
24
|
+
this.botName = botName;
|
|
25
|
+
this.action = action;
|
|
26
|
+
this.traceId = traceId;
|
|
27
|
+
this.isInitialized = true;
|
|
28
|
+
this.queryResults = [];
|
|
29
|
+
this.matchResults = [];
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* This result will be shown to user as a response to inline query.
|
|
34
|
+
* @param queryResult Inline query result to be shown to user.
|
|
35
|
+
*/
|
|
36
|
+
showInlineQueryResult(queryResult) {
|
|
37
|
+
this.queryResults.push(queryResult);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.InlineQueryContext = InlineQueryContext;
|
|
@@ -4,7 +4,7 @@ import { IActionState } from '../../types/actionState';
|
|
|
4
4
|
import { ChatContext } from './chatContext';
|
|
5
5
|
import { IncomingMessage } from '../../dtos/incomingMessage';
|
|
6
6
|
import { MessageSendingOptions, TextMessageSendingOptions } from '../../types/messageSendingOptions';
|
|
7
|
-
import { IActionWithState } from '../../types/
|
|
7
|
+
import { IActionWithState } from '../../types/statefulAction';
|
|
8
8
|
import { MessageTypeValue } from '../../types/messageTypes';
|
|
9
9
|
import { ILogger } from '../../types/logger';
|
|
10
10
|
import { IScheduler } from '../../types/scheduler';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageContext.d.ts","sourceRoot":"","sources":["../../../entities/context/messageContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAMvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAa,MAAM,
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