chz-telegram-bot 0.5.4 → 0.5.5
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/builtin/helpAction.d.ts +2 -0
- package/dist/builtin/helpAction.d.ts.map +1 -0
- package/dist/builtin/helpAction.js +14 -0
- package/dist/dtos/chatHistoryMessage.d.ts +35 -0
- package/dist/dtos/chatHistoryMessage.d.ts.map +1 -0
- package/dist/dtos/chatHistoryMessage.js +32 -0
- package/dist/dtos/chatInfo.d.ts +17 -0
- package/dist/dtos/chatInfo.d.ts.map +1 -0
- package/dist/dtos/chatInfo.js +16 -0
- package/dist/dtos/commandTriggerCheckResult.d.ts +24 -0
- package/dist/dtos/commandTriggerCheckResult.d.ts.map +1 -0
- package/dist/dtos/commandTriggerCheckResult.js +34 -0
- package/dist/dtos/cooldownInfo.d.ts +13 -0
- package/dist/dtos/cooldownInfo.d.ts.map +1 -0
- package/dist/dtos/cooldownInfo.js +12 -0
- package/dist/dtos/incomingMessage.d.ts +19 -0
- package/dist/dtos/incomingMessage.d.ts.map +1 -0
- package/dist/dtos/incomingMessage.js +63 -0
- package/dist/dtos/incomingQuery.d.ts +10 -0
- package/dist/dtos/incomingQuery.d.ts.map +1 -0
- package/dist/dtos/incomingQuery.js +14 -0
- package/dist/dtos/messageInfo.d.ts +22 -0
- package/dist/dtos/messageInfo.d.ts.map +1 -0
- package/dist/dtos/messageInfo.js +20 -0
- package/dist/dtos/propertyProviderSets.d.ts +16 -0
- package/dist/dtos/propertyProviderSets.d.ts.map +1 -0
- package/dist/dtos/propertyProviderSets.js +1 -0
- package/dist/dtos/replyInfo.d.ts +6 -0
- package/dist/dtos/replyInfo.d.ts.map +1 -0
- package/dist/dtos/replyInfo.js +8 -0
- package/dist/dtos/responses/delay.d.ts +16 -0
- package/dist/dtos/responses/delay.d.ts.map +1 -0
- package/dist/dtos/responses/delay.js +15 -0
- package/dist/dtos/responses/imageMessage.d.ts +22 -0
- package/dist/dtos/responses/imageMessage.d.ts.map +1 -0
- package/dist/dtos/responses/imageMessage.js +21 -0
- 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 +16 -0
- package/dist/dtos/responses/reaction.d.ts.map +1 -0
- package/dist/dtos/responses/reaction.js +17 -0
- package/dist/dtos/responses/textMessage.d.ts +23 -0
- package/dist/dtos/responses/textMessage.d.ts.map +1 -0
- package/dist/dtos/responses/textMessage.js +24 -0
- package/dist/dtos/responses/unpin.d.ts +15 -0
- package/dist/dtos/responses/unpin.d.ts.map +1 -0
- package/dist/dtos/responses/unpin.js +15 -0
- package/dist/dtos/responses/videoMessage.d.ts +22 -0
- package/dist/dtos/responses/videoMessage.d.ts.map +1 -0
- package/dist/dtos/responses/videoMessage.js +21 -0
- package/dist/dtos/userInfo.d.ts +12 -0
- package/dist/dtos/userInfo.d.ts.map +1 -0
- package/dist/dtos/userInfo.js +12 -0
- package/dist/entities/actions/commandAction.d.ts +31 -0
- package/dist/entities/actions/commandAction.d.ts.map +1 -0
- package/dist/entities/actions/commandAction.js +139 -0
- 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 +43 -0
- package/dist/entities/actions/replyCaptureAction.d.ts +15 -0
- package/dist/entities/actions/replyCaptureAction.d.ts.map +1 -0
- package/dist/entities/actions/replyCaptureAction.js +58 -0
- package/dist/entities/actions/scheduledAction.d.ts +24 -0
- package/dist/entities/actions/scheduledAction.d.ts.map +1 -0
- package/dist/entities/actions/scheduledAction.js +72 -0
- package/dist/entities/botInstance.d.ts +37 -0
- package/dist/entities/botInstance.d.ts.map +1 -0
- package/dist/entities/botInstance.js +37 -0
- package/dist/entities/cachedStateFactory.d.ts +7 -0
- package/dist/entities/cachedStateFactory.d.ts.map +1 -0
- package/dist/entities/cachedStateFactory.js +8 -0
- package/dist/entities/context/baseContext.d.ts +39 -0
- package/dist/entities/context/baseContext.d.ts.map +1 -0
- package/dist/entities/context/baseContext.js +55 -0
- package/dist/entities/context/chatContext.d.ts +50 -0
- package/dist/entities/context/chatContext.d.ts.map +1 -0
- package/dist/entities/context/chatContext.js +65 -0
- package/dist/entities/context/inlineQueryContext.d.ts +27 -0
- package/dist/entities/context/inlineQueryContext.d.ts.map +1 -0
- package/dist/entities/context/inlineQueryContext.js +29 -0
- package/dist/entities/context/messageContext.d.ts +92 -0
- package/dist/entities/context/messageContext.d.ts.map +1 -0
- package/dist/entities/context/messageContext.js +116 -0
- package/dist/entities/context/replyContext.d.ts +89 -0
- package/dist/entities/context/replyContext.d.ts.map +1 -0
- package/dist/entities/context/replyContext.js +124 -0
- package/dist/entities/states/actionStateBase.d.ts +6 -0
- package/dist/entities/states/actionStateBase.d.ts.map +1 -0
- package/dist/entities/states/actionStateBase.js +4 -0
- package/dist/entities/taskRecord.d.ts +8 -0
- package/dist/entities/taskRecord.d.ts.map +1 -0
- package/dist/entities/taskRecord.js +10 -0
- package/dist/eslint.config.d.ts +3 -0
- package/dist/eslint.config.d.ts.map +1 -0
- package/dist/eslint.config.js +51 -0
- package/dist/helpers/builders/commandActionBuilder.d.ts +100 -0
- package/dist/helpers/builders/commandActionBuilder.d.ts.map +1 -0
- package/dist/helpers/builders/commandActionBuilder.js +146 -0
- package/dist/helpers/builders/inlineQueryActionBuilder.d.ts +37 -0
- package/dist/helpers/builders/inlineQueryActionBuilder.d.ts.map +1 -0
- package/dist/helpers/builders/inlineQueryActionBuilder.js +50 -0
- package/dist/helpers/builders/scheduledActionBuilder.d.ts +68 -0
- package/dist/helpers/builders/scheduledActionBuilder.d.ts.map +1 -0
- package/dist/helpers/builders/scheduledActionBuilder.js +95 -0
- package/dist/helpers/mapUtils.d.ts +10 -0
- package/dist/helpers/mapUtils.d.ts.map +1 -0
- package/dist/helpers/mapUtils.js +13 -0
- package/dist/helpers/noop.d.ts +9 -0
- package/dist/helpers/noop.d.ts.map +1 -0
- package/dist/helpers/noop.js +17 -0
- package/dist/helpers/objectFromEntries.d.ts +2 -0
- package/dist/helpers/objectFromEntries.d.ts.map +1 -0
- package/dist/helpers/objectFromEntries.js +3 -0
- package/dist/helpers/timeConvertions.d.ts +5 -0
- package/dist/helpers/timeConvertions.d.ts.map +1 -0
- package/dist/helpers/timeConvertions.js +9 -0
- package/dist/helpers/toArray.d.ts +2 -0
- package/dist/helpers/toArray.d.ts.map +1 -0
- package/dist/helpers/toArray.js +3 -0
- package/dist/helpers/traceFactory.d.ts +3 -0
- package/dist/helpers/traceFactory.d.ts.map +1 -0
- package/dist/helpers/traceFactory.js +3 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/main.d.ts +52 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +34 -0
- package/dist/services/actionProcessingService.d.ts +25 -0
- package/dist/services/actionProcessingService.d.ts.map +1 -0
- package/dist/services/actionProcessingService.js +50 -0
- package/dist/services/actionProcessors/baseProcessor.d.ts +18 -0
- package/dist/services/actionProcessors/baseProcessor.d.ts.map +1 -0
- package/dist/services/actionProcessors/baseProcessor.js +29 -0
- package/dist/services/actionProcessors/commandActionProcessor.d.ts +20 -0
- package/dist/services/actionProcessors/commandActionProcessor.d.ts.map +1 -0
- package/dist/services/actionProcessors/commandActionProcessor.js +116 -0
- package/dist/services/actionProcessors/inlineQueryActionProcessor.d.ts +11 -0
- package/dist/services/actionProcessors/inlineQueryActionProcessor.d.ts.map +1 -0
- package/dist/services/actionProcessors/inlineQueryActionProcessor.js +61 -0
- package/dist/services/actionProcessors/scheduledActionProcessor.d.ts +17 -0
- package/dist/services/actionProcessors/scheduledActionProcessor.d.ts.map +1 -0
- package/dist/services/actionProcessors/scheduledActionProcessor.js +56 -0
- package/dist/services/jsonFileStorage.d.ts +23 -0
- package/dist/services/jsonFileStorage.d.ts.map +1 -0
- package/dist/services/jsonFileStorage.js +109 -0
- package/dist/services/jsonLogger.d.ts +11 -0
- package/dist/services/jsonLogger.d.ts.map +1 -0
- package/dist/services/jsonLogger.js +66 -0
- package/dist/services/nodeTimeoutScheduler.d.ts +13 -0
- package/dist/services/nodeTimeoutScheduler.d.ts.map +1 -0
- package/dist/services/nodeTimeoutScheduler.js +31 -0
- package/dist/services/responseProcessingQueue.d.ts +12 -0
- package/dist/services/responseProcessingQueue.d.ts.map +1 -0
- package/dist/services/responseProcessingQueue.js +37 -0
- package/dist/services/telegramApi.d.ts +23 -0
- package/dist/services/telegramApi.d.ts.map +1 -0
- package/dist/services/telegramApi.js +133 -0
- package/dist/types/action.d.ts +14 -0
- package/dist/types/action.d.ts.map +1 -0
- package/dist/types/action.js +1 -0
- package/dist/types/actionState.d.ts +5 -0
- package/dist/types/actionState.d.ts.map +1 -0
- package/dist/types/actionState.js +1 -0
- package/dist/types/cachedValueAccessor.d.ts +2 -0
- package/dist/types/cachedValueAccessor.d.ts.map +1 -0
- package/dist/types/cachedValueAccessor.js +1 -0
- package/dist/types/capture.d.ts +24 -0
- package/dist/types/capture.d.ts.map +1 -0
- package/dist/types/capture.js +1 -0
- package/dist/types/commandCondition.d.ts +8 -0
- package/dist/types/commandCondition.d.ts.map +1 -0
- package/dist/types/commandCondition.js +1 -0
- package/dist/types/commandTrigger.d.ts +2 -0
- package/dist/types/commandTrigger.d.ts.map +1 -0
- package/dist/types/commandTrigger.js +1 -0
- package/dist/types/externalAliases.d.ts +11 -0
- package/dist/types/externalAliases.d.ts.map +1 -0
- package/dist/types/externalAliases.js +1 -0
- package/dist/types/handlers.d.ts +21 -0
- package/dist/types/handlers.d.ts.map +1 -0
- package/dist/types/handlers.js +1 -0
- package/dist/types/inputFile.d.ts +5 -0
- package/dist/types/inputFile.d.ts.map +1 -0
- package/dist/types/inputFile.js +1 -0
- package/dist/types/logger.d.ts +13 -0
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/logger.js +1 -0
- package/dist/types/messageSendingOptions.d.ts +9 -0
- package/dist/types/messageSendingOptions.d.ts.map +1 -0
- package/dist/types/messageSendingOptions.js +1 -0
- package/dist/types/messageTypes.d.ts +20 -0
- package/dist/types/messageTypes.d.ts.map +1 -0
- package/dist/types/messageTypes.js +18 -0
- package/dist/types/propertyProvider.d.ts +8 -0
- package/dist/types/propertyProvider.d.ts.map +1 -0
- package/dist/types/propertyProvider.js +1 -0
- package/dist/types/response.d.ts +39 -0
- package/dist/types/response.d.ts.map +1 -0
- package/dist/types/response.js +9 -0
- package/dist/types/scheduler.d.ts +7 -0
- package/dist/types/scheduler.d.ts.map +1 -0
- package/dist/types/scheduler.js +1 -0
- package/dist/types/storage.d.ts +11 -0
- package/dist/types/storage.d.ts.map +1 -0
- package/dist/types/storage.js +1 -0
- package/dist/types/timeValues.d.ts +15 -0
- package/dist/types/timeValues.d.ts.map +1 -0
- package/dist/types/timeValues.js +1 -0
- package/dist/types/trace.d.ts +6 -0
- package/dist/types/trace.d.ts.map +1 -0
- package/dist/types/trace.js +1 -0
- package/package.json +38 -38
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpAction.d.ts","sourceRoot":"","sources":["../../builtin/helpAction.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,4DAatE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CommandActionBuilder } from '../helpers/builders/commandActionBuilder';
|
|
2
|
+
export function buildHelpCommand(readmes, botUsername) {
|
|
3
|
+
const helpCommandBuilder = new CommandActionBuilder('Reaction.Help')
|
|
4
|
+
.on(['/help', `/help@${botUsername}`])
|
|
5
|
+
.do((ctx) => {
|
|
6
|
+
ctx.reply.withText(readmes.join('\n\n'));
|
|
7
|
+
})
|
|
8
|
+
.withCooldown({
|
|
9
|
+
cooldown: 60
|
|
10
|
+
});
|
|
11
|
+
if (readmes.length == 0)
|
|
12
|
+
helpCommandBuilder.disabled();
|
|
13
|
+
return helpCommandBuilder.build();
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TelegramUser } from '../types/externalAliases';
|
|
2
|
+
import { MessageTypeValue } from '../types/messageTypes';
|
|
3
|
+
import { TraceId } from '../types/trace';
|
|
4
|
+
export declare class ChatHistoryMessage {
|
|
5
|
+
/** The unique identifier for the message */
|
|
6
|
+
readonly id: number;
|
|
7
|
+
/** The user who sent the message */
|
|
8
|
+
readonly from: TelegramUser | undefined;
|
|
9
|
+
/** The content of the message */
|
|
10
|
+
readonly text: string;
|
|
11
|
+
/** The type of the message */
|
|
12
|
+
readonly type: MessageTypeValue;
|
|
13
|
+
/** The trace identifier for the message */
|
|
14
|
+
readonly traceId: TraceId;
|
|
15
|
+
/** The identifier for the message this message is replying to */
|
|
16
|
+
readonly replyToId: number | undefined;
|
|
17
|
+
/** The date the message was sent, represented as a Unix timestamp */
|
|
18
|
+
readonly date: number;
|
|
19
|
+
constructor(
|
|
20
|
+
/** The unique identifier for the message */
|
|
21
|
+
id: number,
|
|
22
|
+
/** The user who sent the message */
|
|
23
|
+
from: TelegramUser | undefined,
|
|
24
|
+
/** The content of the message */
|
|
25
|
+
text: string,
|
|
26
|
+
/** The type of the message */
|
|
27
|
+
type: MessageTypeValue,
|
|
28
|
+
/** The trace identifier for the message */
|
|
29
|
+
traceId: TraceId,
|
|
30
|
+
/** The identifier for the message this message is replying to */
|
|
31
|
+
replyToId: number | undefined,
|
|
32
|
+
/** The date the message was sent, represented as a Unix timestamp */
|
|
33
|
+
date: number);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=chatHistoryMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatHistoryMessage.d.ts","sourceRoot":"","sources":["../../dtos/chatHistoryMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,qBAAa,kBAAkB;IAEvB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,oCAAoC;IACpC,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS;IACvC,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,gBAAgB;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,OAAO;IACzB,iEAAiE;IACjE,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IACtC,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM;;IAbrB,4CAA4C;IACnC,EAAE,EAAE,MAAM;IACnB,oCAAoC;IAC3B,IAAI,EAAE,YAAY,GAAG,SAAS;IACvC,iCAAiC;IACxB,IAAI,EAAE,MAAM;IACrB,8BAA8B;IACrB,IAAI,EAAE,gBAAgB;IAC/B,2CAA2C;IAClC,OAAO,EAAE,OAAO;IACzB,iEAAiE;IACxD,SAAS,EAAE,MAAM,GAAG,SAAS;IACtC,qEAAqE;IAC5D,IAAI,EAAE,MAAM;CAE5B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class ChatHistoryMessage {
|
|
2
|
+
id;
|
|
3
|
+
from;
|
|
4
|
+
text;
|
|
5
|
+
type;
|
|
6
|
+
traceId;
|
|
7
|
+
replyToId;
|
|
8
|
+
date;
|
|
9
|
+
constructor(
|
|
10
|
+
/** The unique identifier for the message */
|
|
11
|
+
id,
|
|
12
|
+
/** The user who sent the message */
|
|
13
|
+
from,
|
|
14
|
+
/** The content of the message */
|
|
15
|
+
text,
|
|
16
|
+
/** The type of the message */
|
|
17
|
+
type,
|
|
18
|
+
/** The trace identifier for the message */
|
|
19
|
+
traceId,
|
|
20
|
+
/** The identifier for the message this message is replying to */
|
|
21
|
+
replyToId,
|
|
22
|
+
/** The date the message was sent, represented as a Unix timestamp */
|
|
23
|
+
date) {
|
|
24
|
+
this.id = id;
|
|
25
|
+
this.from = from;
|
|
26
|
+
this.text = text;
|
|
27
|
+
this.type = type;
|
|
28
|
+
this.traceId = traceId;
|
|
29
|
+
this.replyToId = replyToId;
|
|
30
|
+
this.date = date;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChatHistoryMessage } from './chatHistoryMessage';
|
|
2
|
+
export declare class ChatInfo {
|
|
3
|
+
/** Id of a chat that action is executed in. */
|
|
4
|
+
readonly id: number;
|
|
5
|
+
/** Name of a chat that action is executed in. */
|
|
6
|
+
readonly name: string;
|
|
7
|
+
/** Last 100 messages in chat where action is executed */
|
|
8
|
+
readonly messageHistory: ChatHistoryMessage[];
|
|
9
|
+
constructor(
|
|
10
|
+
/** Id of a chat that action is executed in. */
|
|
11
|
+
id: number,
|
|
12
|
+
/** Name of a chat that action is executed in. */
|
|
13
|
+
name: string,
|
|
14
|
+
/** Last 100 messages in chat where action is executed */
|
|
15
|
+
messageHistory: ChatHistoryMessage[]);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=chatInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatInfo.d.ts","sourceRoot":"","sources":["../../dtos/chatInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,QAAQ;IAEb,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,yDAAyD;IACzD,QAAQ,CAAC,cAAc,EAAE,kBAAkB,EAAE;;IAL7C,+CAA+C;IACtC,EAAE,EAAE,MAAM;IACnB,iDAAiD;IACxC,IAAI,EAAE,MAAM;IACrB,yDAAyD;IAChD,cAAc,EAAE,kBAAkB,EAAE;CAEpD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class ChatInfo {
|
|
2
|
+
id;
|
|
3
|
+
name;
|
|
4
|
+
messageHistory;
|
|
5
|
+
constructor(
|
|
6
|
+
/** Id of a chat that action is executed in. */
|
|
7
|
+
id,
|
|
8
|
+
/** Name of a chat that action is executed in. */
|
|
9
|
+
name,
|
|
10
|
+
/** Last 100 messages in chat where action is executed */
|
|
11
|
+
messageHistory) {
|
|
12
|
+
this.id = id;
|
|
13
|
+
this.name = name;
|
|
14
|
+
this.messageHistory = messageHistory;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _SkipTriggerReasonsObject: {
|
|
2
|
+
readonly UserIdMissing: "UserIdMissing";
|
|
3
|
+
readonly UserForbidden: "UserForbidden";
|
|
4
|
+
readonly OnCooldown: "OnCooldown";
|
|
5
|
+
readonly CustomConditionNotMet: "CustomConditionNotMet";
|
|
6
|
+
readonly TriggerNotSatisfied: "TriggerNotSatisfied";
|
|
7
|
+
readonly Other: "Other";
|
|
8
|
+
readonly ActionDisabled: "ActionDisabled";
|
|
9
|
+
readonly ChatForbidden: "ChatForbidden";
|
|
10
|
+
};
|
|
11
|
+
export type SkipTriggerReasons = keyof typeof _SkipTriggerReasonsObject;
|
|
12
|
+
export declare class CommandTriggerCheckResult {
|
|
13
|
+
readonly shouldExecute: boolean;
|
|
14
|
+
readonly matchResults: RegExpExecArray[];
|
|
15
|
+
readonly skipCooldown: boolean;
|
|
16
|
+
readonly reason?: SkipTriggerReasons | undefined;
|
|
17
|
+
static DontTriggerAndSkipCooldown(reason: SkipTriggerReasons): CommandTriggerCheckResult;
|
|
18
|
+
static DoNotTrigger(reason: SkipTriggerReasons): CommandTriggerCheckResult;
|
|
19
|
+
static Trigger(): CommandTriggerCheckResult;
|
|
20
|
+
constructor(shouldExecute: boolean, matchResults: RegExpExecArray[], skipCooldown: boolean, reason?: SkipTriggerReasons | undefined);
|
|
21
|
+
mergeWith(other: CommandTriggerCheckResult): CommandTriggerCheckResult;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=commandTriggerCheckResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandTriggerCheckResult.d.ts","sourceRoot":"","sources":["../../dtos/commandTriggerCheckResult.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,yBAAyB;;;;;;;;;CASrB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,yBAAyB,CAAC;AAExE,qBAAa,yBAAyB;IAY9B,QAAQ,CAAC,aAAa,EAAE,OAAO;IAC/B,QAAQ,CAAC,YAAY,EAAE,eAAe,EAAE;IACxC,QAAQ,CAAC,YAAY,EAAE,OAAO;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB;IAdxC,MAAM,CAAC,0BAA0B,CAAC,MAAM,EAAE,kBAAkB;IAG5D,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,kBAAkB;IAG9C,MAAM,CAAC,OAAO;gBAKD,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,eAAe,EAAE,EAC/B,YAAY,EAAE,OAAO,EACrB,MAAM,CAAC,EAAE,kBAAkB,YAAA;IAGxC,SAAS,CAAC,KAAK,EAAE,yBAAyB;CAQ7C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const _SkipTriggerReasonsObject = {
|
|
2
|
+
UserIdMissing: 'UserIdMissing',
|
|
3
|
+
UserForbidden: 'UserForbidden',
|
|
4
|
+
OnCooldown: 'OnCooldown',
|
|
5
|
+
CustomConditionNotMet: 'CustomConditionNotMet',
|
|
6
|
+
TriggerNotSatisfied: 'TriggerNotSatisfied',
|
|
7
|
+
Other: 'Other',
|
|
8
|
+
ActionDisabled: 'ActionDisabled',
|
|
9
|
+
ChatForbidden: 'ChatForbidden'
|
|
10
|
+
};
|
|
11
|
+
export class CommandTriggerCheckResult {
|
|
12
|
+
shouldExecute;
|
|
13
|
+
matchResults;
|
|
14
|
+
skipCooldown;
|
|
15
|
+
reason;
|
|
16
|
+
static DontTriggerAndSkipCooldown(reason) {
|
|
17
|
+
return new CommandTriggerCheckResult(false, [], true, reason);
|
|
18
|
+
}
|
|
19
|
+
static DoNotTrigger(reason) {
|
|
20
|
+
return new CommandTriggerCheckResult(false, [], false, reason);
|
|
21
|
+
}
|
|
22
|
+
static Trigger() {
|
|
23
|
+
return new CommandTriggerCheckResult(true, [], false);
|
|
24
|
+
}
|
|
25
|
+
constructor(shouldExecute, matchResults, skipCooldown, reason) {
|
|
26
|
+
this.shouldExecute = shouldExecute;
|
|
27
|
+
this.matchResults = matchResults;
|
|
28
|
+
this.skipCooldown = skipCooldown;
|
|
29
|
+
this.reason = reason;
|
|
30
|
+
}
|
|
31
|
+
mergeWith(other) {
|
|
32
|
+
return new CommandTriggerCheckResult(this.shouldExecute || other.shouldExecute, this.matchResults.concat(other.matchResults), this.skipCooldown || other.skipCooldown, other.reason);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Seconds } from '../types/timeValues';
|
|
2
|
+
export declare class CooldownInfo {
|
|
3
|
+
/** Cooldown configuration */
|
|
4
|
+
readonly cooldown: Seconds;
|
|
5
|
+
/** Cooldown message to be shown */
|
|
6
|
+
readonly message?: string | undefined;
|
|
7
|
+
constructor(
|
|
8
|
+
/** Cooldown configuration */
|
|
9
|
+
cooldown: Seconds,
|
|
10
|
+
/** Cooldown message to be shown */
|
|
11
|
+
message?: string | undefined);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=cooldownInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cooldownInfo.d.ts","sourceRoot":"","sources":["../../dtos/cooldownInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,qBAAa,YAAY;IAEjB,6BAA6B;IAC7B,QAAQ,CAAC,QAAQ,EAAE,OAAO;IAC1B,mCAAmC;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM;;IAHzB,6BAA6B;IACpB,QAAQ,EAAE,OAAO;IAC1B,mCAAmC;IAC1B,OAAO,CAAC,EAAE,MAAM,YAAA;CAEhC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MessageTypeValue } from '../types/messageTypes';
|
|
2
|
+
import { ChatInfo } from './chatInfo';
|
|
3
|
+
import { TraceId } from '../types/trace';
|
|
4
|
+
import { ChatHistoryMessage } from './chatHistoryMessage';
|
|
5
|
+
import { TelegramMessage, TelegramUser } from '../types/externalAliases';
|
|
6
|
+
export declare class IncomingMessage {
|
|
7
|
+
readonly messageId: number;
|
|
8
|
+
readonly chatInfo: ChatInfo;
|
|
9
|
+
readonly from: TelegramUser | undefined;
|
|
10
|
+
readonly text: string;
|
|
11
|
+
readonly type: MessageTypeValue;
|
|
12
|
+
readonly traceId: TraceId;
|
|
13
|
+
readonly replyToMessageId: number | undefined;
|
|
14
|
+
readonly updateObject: TelegramMessage;
|
|
15
|
+
private detectMessageType;
|
|
16
|
+
constructor(ctxMessage: TelegramMessage, botName: string, history: ChatHistoryMessage[]);
|
|
17
|
+
private getMessageText;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=incomingMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incomingMessage.d.ts","sourceRoot":"","sources":["../../dtos/incomingMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAEzE,qBAAa,eAAe;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IAE9C,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;IAEvC,OAAO,CAAC,iBAAiB;gBAmBrB,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,kBAAkB,EAAE;IAyBjC,OAAO,CAAC,cAAc;CAKzB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { randomInt } from 'crypto';
|
|
2
|
+
import { MessageType } from '../types/messageTypes';
|
|
3
|
+
import { ChatInfo } from './chatInfo';
|
|
4
|
+
import { createTrace } from '../helpers/traceFactory';
|
|
5
|
+
export class IncomingMessage {
|
|
6
|
+
messageId;
|
|
7
|
+
chatInfo;
|
|
8
|
+
from;
|
|
9
|
+
text;
|
|
10
|
+
type;
|
|
11
|
+
traceId;
|
|
12
|
+
replyToMessageId;
|
|
13
|
+
updateObject;
|
|
14
|
+
detectMessageType(message) {
|
|
15
|
+
if ('forward_origin' in message)
|
|
16
|
+
return MessageType.Forward;
|
|
17
|
+
if ('text' in message)
|
|
18
|
+
return MessageType.Text;
|
|
19
|
+
if ('video' in message)
|
|
20
|
+
return MessageType.Video;
|
|
21
|
+
if ('photo' in message)
|
|
22
|
+
return MessageType.Photo;
|
|
23
|
+
if ('sticker' in message)
|
|
24
|
+
return MessageType.Sticker;
|
|
25
|
+
if ('animation' in message)
|
|
26
|
+
return MessageType.Animation;
|
|
27
|
+
if ('voice' in message)
|
|
28
|
+
return MessageType.Voice;
|
|
29
|
+
if ('audio' in message)
|
|
30
|
+
return MessageType.Audio;
|
|
31
|
+
if ('document' in message)
|
|
32
|
+
return MessageType.Document;
|
|
33
|
+
if ('left_chat_member' in message)
|
|
34
|
+
return MessageType.LeftChatMember;
|
|
35
|
+
if ('new_chat_member' in message)
|
|
36
|
+
return MessageType.NewChatMember;
|
|
37
|
+
if ('poll' in message)
|
|
38
|
+
return MessageType.Poll;
|
|
39
|
+
if ('location' in message)
|
|
40
|
+
return MessageType.Location;
|
|
41
|
+
return MessageType.Unknown;
|
|
42
|
+
}
|
|
43
|
+
constructor(ctxMessage, botName, history) {
|
|
44
|
+
this.traceId = createTrace(this, botName, randomInt(10000, 99999).toString());
|
|
45
|
+
this.messageId = ctxMessage.message_id;
|
|
46
|
+
this.replyToMessageId =
|
|
47
|
+
'reply_to_message' in ctxMessage
|
|
48
|
+
? ctxMessage.reply_to_message?.message_id
|
|
49
|
+
: undefined;
|
|
50
|
+
this.from = ctxMessage.from;
|
|
51
|
+
this.text = this.getMessageText(ctxMessage);
|
|
52
|
+
this.chatInfo = new ChatInfo(ctxMessage.chat.id, 'title' in ctxMessage.chat
|
|
53
|
+
? `${ctxMessage.chat.title} ${ctxMessage.chat.id}`
|
|
54
|
+
: 'DM', history);
|
|
55
|
+
this.type = this.detectMessageType(ctxMessage);
|
|
56
|
+
this.updateObject = ctxMessage;
|
|
57
|
+
}
|
|
58
|
+
getMessageText(ctxMessage) {
|
|
59
|
+
if ('text' in ctxMessage)
|
|
60
|
+
return ctxMessage.text;
|
|
61
|
+
return 'caption' in ctxMessage ? ctxMessage.caption ?? '' : '';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
readonly abortController: AbortController;
|
|
8
|
+
constructor(queryId: string, query: string, userId: number, traceId: TraceId);
|
|
9
|
+
}
|
|
10
|
+
//# 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;IAIxB,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO;IAN7B,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;gBAG7B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO;CAIhC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class IncomingInlineQuery {
|
|
2
|
+
queryId;
|
|
3
|
+
query;
|
|
4
|
+
userId;
|
|
5
|
+
traceId;
|
|
6
|
+
abortController;
|
|
7
|
+
constructor(queryId, query, userId, traceId) {
|
|
8
|
+
this.queryId = queryId;
|
|
9
|
+
this.query = query;
|
|
10
|
+
this.userId = userId;
|
|
11
|
+
this.traceId = traceId;
|
|
12
|
+
this.abortController = new AbortController();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TelegramMessage } from '../types/externalAliases';
|
|
2
|
+
import { MessageTypeValue } from '../types/messageTypes';
|
|
3
|
+
export declare class MessageInfo {
|
|
4
|
+
/** Id of a message that triggered this action. */
|
|
5
|
+
readonly id: number;
|
|
6
|
+
/** Text of a message that triggered this action. */
|
|
7
|
+
readonly text: string;
|
|
8
|
+
/** Type of message being received */
|
|
9
|
+
readonly type: MessageTypeValue;
|
|
10
|
+
/** Message object recieved from Telegram */
|
|
11
|
+
readonly telegramUpdateObject: TelegramMessage;
|
|
12
|
+
constructor(
|
|
13
|
+
/** Id of a message that triggered this action. */
|
|
14
|
+
id: number,
|
|
15
|
+
/** Text of a message that triggered this action. */
|
|
16
|
+
text: string,
|
|
17
|
+
/** Type of message being received */
|
|
18
|
+
type: MessageTypeValue,
|
|
19
|
+
/** Message object recieved from Telegram */
|
|
20
|
+
telegramUpdateObject: TelegramMessage);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=messageInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageInfo.d.ts","sourceRoot":"","sources":["../../dtos/messageInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,qBAAa,WAAW;IAEhB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,oDAAoD;IACpD,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,gBAAgB;IAC/B,4CAA4C;IAC5C,QAAQ,CAAC,oBAAoB,EAAE,eAAe;;IAP9C,kDAAkD;IACzC,EAAE,EAAE,MAAM;IACnB,oDAAoD;IAC3C,IAAI,EAAE,MAAM;IACrB,qCAAqC;IAC5B,IAAI,EAAE,gBAAgB;IAC/B,4CAA4C;IACnC,oBAAoB,EAAE,eAAe;CAErD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class MessageInfo {
|
|
2
|
+
id;
|
|
3
|
+
text;
|
|
4
|
+
type;
|
|
5
|
+
telegramUpdateObject;
|
|
6
|
+
constructor(
|
|
7
|
+
/** Id of a message that triggered this action. */
|
|
8
|
+
id,
|
|
9
|
+
/** Text of a message that triggered this action. */
|
|
10
|
+
text,
|
|
11
|
+
/** Type of message being received */
|
|
12
|
+
type,
|
|
13
|
+
/** Message object recieved from Telegram */
|
|
14
|
+
telegramUpdateObject) {
|
|
15
|
+
this.id = id;
|
|
16
|
+
this.text = text;
|
|
17
|
+
this.type = type;
|
|
18
|
+
this.telegramUpdateObject = telegramUpdateObject;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CooldownInfo } from './cooldownInfo';
|
|
2
|
+
import { CommandActionPropertyProvider, ScheduledActionPropertyProvider } from '../types/propertyProvider';
|
|
3
|
+
import { HoursOfDay } from '../types/timeValues';
|
|
4
|
+
export type CommandActionProviders = {
|
|
5
|
+
cooldownProvider: CommandActionPropertyProvider<CooldownInfo>;
|
|
6
|
+
isActiveProvider: CommandActionPropertyProvider<boolean>;
|
|
7
|
+
chatsBlacklistProvider: CommandActionPropertyProvider<number[]>;
|
|
8
|
+
chatsWhitelistProvider: CommandActionPropertyProvider<number[]>;
|
|
9
|
+
usersWhitelistProvider: CommandActionPropertyProvider<number[]>;
|
|
10
|
+
};
|
|
11
|
+
export type ScheduledActionProviders = {
|
|
12
|
+
timeinHoursProvider: ScheduledActionPropertyProvider<HoursOfDay>;
|
|
13
|
+
isActiveProvider: ScheduledActionPropertyProvider<boolean>;
|
|
14
|
+
chatsWhitelistProvider: ScheduledActionPropertyProvider<number[]>;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=propertyProviderSets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propertyProviderSets.d.ts","sourceRoot":"","sources":["../../dtos/propertyProviderSets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACH,6BAA6B,EAC7B,+BAA+B,EAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,MAAM,sBAAsB,GAAG;IACjC,gBAAgB,EAAE,6BAA6B,CAAC,YAAY,CAAC,CAAC;IAC9D,gBAAgB,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACzD,sBAAsB,EAAE,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC;IAChE,sBAAsB,EAAE,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC;IAChE,sBAAsB,EAAE,6BAA6B,CAAC,MAAM,EAAE,CAAC,CAAC;CACnE,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,mBAAmB,EAAE,+BAA+B,CAAC,UAAU,CAAC,CAAC;IACjE,gBAAgB,EAAE,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAC3D,sBAAsB,EAAE,+BAA+B,CAAC,MAAM,EAAE,CAAC,CAAC;CACrE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replyInfo.d.ts","sourceRoot":"","sources":["../../dtos/replyInfo.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;IAClB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEvB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CAIzC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IActionState } from '../../types/actionState';
|
|
2
|
+
import { IActionWithState } from '../../types/action';
|
|
3
|
+
import { IChatResponse } from '../../types/response';
|
|
4
|
+
import { Milliseconds } from '../../types/timeValues';
|
|
5
|
+
import { TraceId } from '../../types/trace';
|
|
6
|
+
import { ChatInfo } from '../chatInfo';
|
|
7
|
+
export declare class DelayResponse implements IChatResponse {
|
|
8
|
+
readonly kind: "delay";
|
|
9
|
+
readonly createdAt: number;
|
|
10
|
+
readonly chatInfo: ChatInfo;
|
|
11
|
+
readonly traceId: TraceId;
|
|
12
|
+
readonly delay: Milliseconds;
|
|
13
|
+
readonly action: IActionWithState<IActionState>;
|
|
14
|
+
constructor(delay: Milliseconds, chatInfo: ChatInfo, traceId: TraceId, action: IActionWithState<IActionState>);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=delay.d.ts.map
|
|
@@ -0,0 +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,oBAAoB,CAAC;AACtD,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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BotResponseTypes } from '../../types/response';
|
|
2
|
+
export class DelayResponse {
|
|
3
|
+
kind = BotResponseTypes.delay;
|
|
4
|
+
createdAt = Date.now();
|
|
5
|
+
chatInfo;
|
|
6
|
+
traceId;
|
|
7
|
+
delay;
|
|
8
|
+
action;
|
|
9
|
+
constructor(delay, chatInfo, traceId, action) {
|
|
10
|
+
this.chatInfo = chatInfo;
|
|
11
|
+
this.delay = delay;
|
|
12
|
+
this.traceId = traceId;
|
|
13
|
+
this.action = action;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IReplyResponseWithContent } from '../../types/response';
|
|
2
|
+
import { MessageSendingOptions } from '../../types/messageSendingOptions';
|
|
3
|
+
import { IAction } from '../../types/action';
|
|
4
|
+
import { ChatInfo } from '../chatInfo';
|
|
5
|
+
import { TraceId } from '../../types/trace';
|
|
6
|
+
import { ReplyInfo } from '../replyInfo';
|
|
7
|
+
import { IReplyCapture } from '../../types/capture';
|
|
8
|
+
import { InputFile } from '../../types/inputFile';
|
|
9
|
+
export declare class ImageMessage implements IReplyResponseWithContent<InputFile> {
|
|
10
|
+
readonly kind: "image";
|
|
11
|
+
readonly createdAt: number;
|
|
12
|
+
readonly captures: IReplyCapture[];
|
|
13
|
+
readonly content: InputFile;
|
|
14
|
+
readonly chatInfo: ChatInfo;
|
|
15
|
+
readonly replyInfo: ReplyInfo | undefined;
|
|
16
|
+
readonly traceId: TraceId;
|
|
17
|
+
readonly disableWebPreview = false;
|
|
18
|
+
readonly shouldPin: boolean;
|
|
19
|
+
readonly action: IAction;
|
|
20
|
+
constructor(image: InputFile, chatInfo: ChatInfo, traceId: TraceId, action: IAction, replyInfo: ReplyInfo | undefined, options?: MessageSendingOptions);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=imageMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageMessage.d.ts","sourceRoot":"","sources":["../../../dtos/responses/imageMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,yBAAyB,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,YAAa,YAAW,yBAAyB,CAAC,SAAS,CAAC;IACrE,QAAQ,CAAC,IAAI,UAA0B;IACvC,QAAQ,CAAC,SAAS,SAAc;IAChC,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAM;IAExC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,SAAS;IACnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBAGrB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,OAAO,CAAC,EAAE,qBAAqB;CAStC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BotResponseTypes } from '../../types/response';
|
|
2
|
+
export class ImageMessage {
|
|
3
|
+
kind = BotResponseTypes.image;
|
|
4
|
+
createdAt = Date.now();
|
|
5
|
+
captures = [];
|
|
6
|
+
content;
|
|
7
|
+
chatInfo;
|
|
8
|
+
replyInfo;
|
|
9
|
+
traceId;
|
|
10
|
+
disableWebPreview = false;
|
|
11
|
+
shouldPin;
|
|
12
|
+
action;
|
|
13
|
+
constructor(image, chatInfo, traceId, action, replyInfo, options) {
|
|
14
|
+
this.content = image;
|
|
15
|
+
this.chatInfo = chatInfo;
|
|
16
|
+
this.replyInfo = replyInfo;
|
|
17
|
+
this.traceId = traceId;
|
|
18
|
+
this.shouldPin = options?.pin ?? false;
|
|
19
|
+
this.action = action;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InlineQueryAction } from '../../entities/actions/inlineQueryAction';
|
|
2
|
+
import { TelegramInlineQueryResult } from '../../types/externalAliases';
|
|
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: TelegramInlineQueryResult[];
|
|
11
|
+
constructor(queryResult: TelegramInlineQueryResult[], 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,0CAA0C,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,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,yBAAyB,EAAE,CAAC;gBAG/C,WAAW,EAAE,yBAAyB,EAAE,EACxC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,iBAAiB;CAOhC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BotResponseTypes } from '../../types/response';
|
|
2
|
+
export class InlineQueryResponse {
|
|
3
|
+
kind = BotResponseTypes.inlineQuery;
|
|
4
|
+
createdAt = Date.now();
|
|
5
|
+
queryId;
|
|
6
|
+
traceId;
|
|
7
|
+
action;
|
|
8
|
+
queryResults;
|
|
9
|
+
constructor(queryResult, queryId, traceId, action) {
|
|
10
|
+
this.queryResults = queryResult;
|
|
11
|
+
this.queryId = queryId;
|
|
12
|
+
this.traceId = traceId;
|
|
13
|
+
this.action = action;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IChatResponse } from '../../types/response';
|
|
2
|
+
import { IAction } from '../../types/action';
|
|
3
|
+
import { ChatInfo } from '../chatInfo';
|
|
4
|
+
import { TraceId } from '../../types/trace';
|
|
5
|
+
import { TelegramEmoji } from '../../types/externalAliases';
|
|
6
|
+
export declare class Reaction implements IChatResponse {
|
|
7
|
+
readonly kind: "react";
|
|
8
|
+
readonly createdAt: number;
|
|
9
|
+
readonly chatInfo: ChatInfo;
|
|
10
|
+
readonly messageId: number;
|
|
11
|
+
readonly traceId: TraceId;
|
|
12
|
+
readonly emoji: TelegramEmoji;
|
|
13
|
+
readonly action: IAction;
|
|
14
|
+
constructor(traceId: TraceId, chatInfo: ChatInfo, messageId: number, emoji: TelegramEmoji, action: IAction);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=reaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reaction.d.ts","sourceRoot":"","sources":["../../../dtos/responses/reaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,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,OAAO,CAAC;gBAGrB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,OAAO;CAQtB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BotResponseTypes } from '../../types/response';
|
|
2
|
+
export class Reaction {
|
|
3
|
+
kind = BotResponseTypes.react;
|
|
4
|
+
createdAt = Date.now();
|
|
5
|
+
chatInfo;
|
|
6
|
+
messageId;
|
|
7
|
+
traceId;
|
|
8
|
+
emoji;
|
|
9
|
+
action;
|
|
10
|
+
constructor(traceId, chatInfo, messageId, emoji, action) {
|
|
11
|
+
this.chatInfo = chatInfo;
|
|
12
|
+
this.messageId = messageId;
|
|
13
|
+
this.emoji = emoji;
|
|
14
|
+
this.traceId = traceId;
|
|
15
|
+
this.action = action;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TextMessageSendingOptions } from '../../types/messageSendingOptions';
|
|
2
|
+
import { IReplyResponseWithContent } from '../../types/response';
|
|
3
|
+
import { IAction } from '../../types/action';
|
|
4
|
+
import { ChatInfo } from '../chatInfo';
|
|
5
|
+
import { TraceId } from '../../types/trace';
|
|
6
|
+
import { ReplyInfo } from '../replyInfo';
|
|
7
|
+
import { IReplyCapture } from '../../types/capture';
|
|
8
|
+
import { TelegramInlineKeyboardButton } from '../../types/externalAliases';
|
|
9
|
+
export declare class TextMessage implements IReplyResponseWithContent<string> {
|
|
10
|
+
readonly kind: "text";
|
|
11
|
+
readonly createdAt: number;
|
|
12
|
+
readonly captures: IReplyCapture[];
|
|
13
|
+
readonly content: string;
|
|
14
|
+
readonly chatInfo: ChatInfo;
|
|
15
|
+
readonly replyInfo: ReplyInfo | undefined;
|
|
16
|
+
readonly traceId: TraceId;
|
|
17
|
+
readonly disableWebPreview: boolean;
|
|
18
|
+
readonly shouldPin: boolean;
|
|
19
|
+
readonly action: IAction;
|
|
20
|
+
readonly keyboard?: TelegramInlineKeyboardButton[][];
|
|
21
|
+
constructor(text: string, chatInfo: ChatInfo, traceId: TraceId, action: IAction, replyInfo?: ReplyInfo, options?: TextMessageSendingOptions);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=textMessage.d.ts.map
|