@codebam/cf-workers-telegram-bot 11.3.1 → 11.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/telegram_bot.js +1 -1
- package/dist/telegram_execution_context.js +3 -0
- package/dist/types/PartialTelegramUpdate.d.ts +2 -0
- package/dist/types/TelegramBusinessConnection.d.ts +10 -0
- package/dist/types/TelegramBusinessConnection.js +1 -0
- package/dist/types/TelegramUpdate.d.ts +2 -0
- package/dist/types/TelegramUpdate.js +2 -0
- package/package.json +1 -1
package/dist/telegram_bot.js
CHANGED
|
@@ -119,7 +119,7 @@ export default class TelegramBot {
|
|
|
119
119
|
return ':successful_payment' in this.commands ? ':successful_payment' : this.defaultCommand;
|
|
120
120
|
}
|
|
121
121
|
// Then check if it's a command starting with /
|
|
122
|
-
if (args[0]
|
|
122
|
+
if (args[0]?.startsWith('/')) {
|
|
123
123
|
const command = args[0].substring(1, args[0].lastIndexOf('@') > -1 ? args[0].lastIndexOf('@') : args[0].length);
|
|
124
124
|
return command in this.commands ? command : this.defaultCommand;
|
|
125
125
|
}
|
|
@@ -4,6 +4,7 @@ import TelegramMessage from './TelegramMessage.js';
|
|
|
4
4
|
import TelegramGuestMessage from './TelegramGuestMessage.js';
|
|
5
5
|
import TelegramPreCheckoutQuery from './TelegramPreCheckoutQuery.js';
|
|
6
6
|
import TelegramCallbackQuery from './TelegramCallbackQuery.js';
|
|
7
|
+
import TelegramBusinessConnection from './TelegramBusinessConnection.js';
|
|
7
8
|
interface PartialTelegramUpdate {
|
|
8
9
|
update_id?: number;
|
|
9
10
|
message?: TelegramMessage;
|
|
@@ -15,5 +16,6 @@ interface PartialTelegramUpdate {
|
|
|
15
16
|
guest_message?: TelegramGuestMessage;
|
|
16
17
|
pre_checkout_query?: TelegramPreCheckoutQuery;
|
|
17
18
|
callback_query?: TelegramCallbackQuery;
|
|
19
|
+
business_connection?: TelegramBusinessConnection;
|
|
18
20
|
}
|
|
19
21
|
export default PartialTelegramUpdate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,6 +5,7 @@ import TelegramCallbackQuery from './TelegramCallbackQuery.js';
|
|
|
5
5
|
import TelegramBusinessMessage from './TelegramBusinessMessage.js';
|
|
6
6
|
import TelegramGuestMessage from './TelegramGuestMessage.js';
|
|
7
7
|
import TelegramPreCheckoutQuery from './TelegramPreCheckoutQuery.js';
|
|
8
|
+
import TelegramBusinessConnection from './TelegramBusinessConnection.js';
|
|
8
9
|
export default class TelegramUpdate {
|
|
9
10
|
update_id: number;
|
|
10
11
|
message?: TelegramMessage;
|
|
@@ -16,5 +17,6 @@ export default class TelegramUpdate {
|
|
|
16
17
|
business_message?: TelegramBusinessMessage;
|
|
17
18
|
guest_message?: TelegramGuestMessage;
|
|
18
19
|
pre_checkout_query?: TelegramPreCheckoutQuery;
|
|
20
|
+
business_connection?: TelegramBusinessConnection;
|
|
19
21
|
constructor(update: PartialTelegramUpdate);
|
|
20
22
|
}
|
|
@@ -16,6 +16,7 @@ export default class TelegramUpdate {
|
|
|
16
16
|
// my_chat_member?: TelegramChatMemberUpdated;
|
|
17
17
|
// chat_member?: TelegramChatMemberUpdated;
|
|
18
18
|
// chat_join_request: TelegramChatJoinRequest;
|
|
19
|
+
business_connection;
|
|
19
20
|
constructor(update) {
|
|
20
21
|
this.update_id = update.update_id ?? 0;
|
|
21
22
|
this.message = update.message;
|
|
@@ -29,6 +30,7 @@ export default class TelegramUpdate {
|
|
|
29
30
|
this.callback_query = update.callback_query;
|
|
30
31
|
// shipping_query = update.shipping_query;
|
|
31
32
|
this.pre_checkout_query = update.pre_checkout_query;
|
|
33
|
+
this.business_connection = update.business_connection;
|
|
32
34
|
// poll = update.poll;
|
|
33
35
|
// poll_answer = update.poll_answer;
|
|
34
36
|
// my_chat_member = update.my_chat_member;
|