chz-telegram-bot 0.2.0 → 0.2.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telegramApi.d.ts","sourceRoot":"","sources":["../../services/telegramApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiC;IACvD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IAEjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAG7B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,OAAO;IAQnB,uBAAuB,CAAC,SAAS,EAAE,WAAW,EAAE;IA8BhD,cAAc;YAIA,WAAW;YAqBX,eAAe;
|
|
1
|
+
{"version":3,"file":"telegramApi.d.ts","sourceRoot":"","sources":["../../services/telegramApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiC;IACvD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IAEjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAG7B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,OAAO;IAQnB,uBAAuB,CAAC,SAAS,EAAE,WAAW,EAAE;IA8BhD,cAAc;YAIA,WAAW;YAqBX,eAAe;CAmGhC"}
|
|
@@ -49,27 +49,41 @@ class TelegramApiService {
|
|
|
49
49
|
switch (response.kind) {
|
|
50
50
|
case 'text':
|
|
51
51
|
sentMessage = await this.telegram.sendMessage(response.chatInfo.id, response.content, {
|
|
52
|
-
|
|
52
|
+
reply_parameters: response.replyInfo
|
|
53
|
+
? {
|
|
54
|
+
message_id: response.replyInfo.id,
|
|
55
|
+
quote: response.replyInfo.quote
|
|
56
|
+
}
|
|
57
|
+
: undefined,
|
|
53
58
|
parse_mode: 'MarkdownV2',
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
link_preview_options: {
|
|
60
|
+
is_disabled: response.disableWebPreview
|
|
61
|
+
}
|
|
56
62
|
});
|
|
57
63
|
await this.pinIfShould(response, sentMessage);
|
|
58
64
|
break;
|
|
59
65
|
case 'image':
|
|
60
|
-
sentMessage = await this.telegram.sendPhoto(response.chatInfo.id, response.content,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
sentMessage = await this.telegram.sendPhoto(response.chatInfo.id, response.content, {
|
|
67
|
+
reply_parameters: response.replyInfo
|
|
68
|
+
? {
|
|
69
|
+
message_id: response.replyInfo.id,
|
|
70
|
+
quote: response.replyInfo.quote
|
|
71
|
+
}
|
|
72
|
+
: undefined,
|
|
73
|
+
parse_mode: 'MarkdownV2'
|
|
74
|
+
});
|
|
65
75
|
await this.pinIfShould(response, sentMessage);
|
|
66
76
|
break;
|
|
67
77
|
case 'video':
|
|
68
|
-
sentMessage = await this.telegram.sendVideo(response.chatInfo.id, response.content,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
sentMessage = await this.telegram.sendVideo(response.chatInfo.id, response.content, {
|
|
79
|
+
reply_parameters: response.replyInfo
|
|
80
|
+
? {
|
|
81
|
+
message_id: response.replyInfo.id,
|
|
82
|
+
quote: response.replyInfo.quote
|
|
83
|
+
}
|
|
84
|
+
: undefined,
|
|
85
|
+
parse_mode: 'MarkdownV2'
|
|
86
|
+
});
|
|
73
87
|
await this.pinIfShould(response, sentMessage);
|
|
74
88
|
break;
|
|
75
89
|
case 'react':
|
package/package.json
CHANGED
package/services/telegramApi.ts
CHANGED
|
@@ -89,11 +89,17 @@ export class TelegramApiService {
|
|
|
89
89
|
response.chatInfo.id,
|
|
90
90
|
response.content,
|
|
91
91
|
{
|
|
92
|
-
|
|
92
|
+
reply_parameters: response.replyInfo
|
|
93
|
+
? {
|
|
94
|
+
message_id: response.replyInfo.id,
|
|
95
|
+
quote: response.replyInfo.quote
|
|
96
|
+
}
|
|
97
|
+
: undefined,
|
|
93
98
|
parse_mode: 'MarkdownV2',
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
link_preview_options: {
|
|
100
|
+
is_disabled: response.disableWebPreview
|
|
101
|
+
}
|
|
102
|
+
}
|
|
97
103
|
);
|
|
98
104
|
|
|
99
105
|
await this.pinIfShould(response, sentMessage);
|
|
@@ -102,11 +108,15 @@ export class TelegramApiService {
|
|
|
102
108
|
sentMessage = await this.telegram.sendPhoto(
|
|
103
109
|
response.chatInfo.id,
|
|
104
110
|
response.content,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
{
|
|
112
|
+
reply_parameters: response.replyInfo
|
|
113
|
+
? {
|
|
114
|
+
message_id: response.replyInfo.id,
|
|
115
|
+
quote: response.replyInfo.quote
|
|
116
|
+
}
|
|
117
|
+
: undefined,
|
|
118
|
+
parse_mode: 'MarkdownV2'
|
|
119
|
+
}
|
|
110
120
|
);
|
|
111
121
|
|
|
112
122
|
await this.pinIfShould(response, sentMessage);
|
|
@@ -115,11 +125,15 @@ export class TelegramApiService {
|
|
|
115
125
|
sentMessage = await this.telegram.sendVideo(
|
|
116
126
|
response.chatInfo.id,
|
|
117
127
|
response.content,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
128
|
+
{
|
|
129
|
+
reply_parameters: response.replyInfo
|
|
130
|
+
? {
|
|
131
|
+
message_id: response.replyInfo.id,
|
|
132
|
+
quote: response.replyInfo.quote
|
|
133
|
+
}
|
|
134
|
+
: undefined,
|
|
135
|
+
parse_mode: 'MarkdownV2'
|
|
136
|
+
}
|
|
123
137
|
);
|
|
124
138
|
|
|
125
139
|
await this.pinIfShould(response, sentMessage);
|