@codebam/cf-workers-telegram-bot 12.6.8 → 12.6.10
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 +8 -0
- package/dist/webhook.js +10 -1
- package/package.json +1 -1
package/dist/telegram_bot.js
CHANGED
|
@@ -135,6 +135,14 @@ export default class TelegramBot {
|
|
|
135
135
|
}
|
|
136
136
|
const fullCommand = args[commandIndex];
|
|
137
137
|
const command = fullCommand.substring(1, fullCommand.lastIndexOf('@') > -1 ? fullCommand.lastIndexOf('@') : fullCommand.length);
|
|
138
|
+
if (ctx.update_type === 'business_message') {
|
|
139
|
+
const isOwner = ctx.update.business_message?.from?.id !== ctx.update.business_message?.chat?.id;
|
|
140
|
+
if (command === 'clear' && isOwner) {
|
|
141
|
+
ctx.args = args.slice(commandIndex);
|
|
142
|
+
return command;
|
|
143
|
+
}
|
|
144
|
+
return this.defaultCommand;
|
|
145
|
+
}
|
|
138
146
|
if (command in this.commands) {
|
|
139
147
|
// Shift args so the command handler sees the command at index 0
|
|
140
148
|
ctx.args = args.slice(commandIndex);
|
package/dist/webhook.js
CHANGED
|
@@ -34,7 +34,16 @@ export default class Webhook {
|
|
|
34
34
|
const params = {
|
|
35
35
|
url: this.webhook.toString(),
|
|
36
36
|
max_connections: '40',
|
|
37
|
-
allowed_updates: JSON.stringify([
|
|
37
|
+
allowed_updates: JSON.stringify([
|
|
38
|
+
'message',
|
|
39
|
+
'edited_message',
|
|
40
|
+
'callback_query',
|
|
41
|
+
'inline_query',
|
|
42
|
+
'guest_message',
|
|
43
|
+
'business_message',
|
|
44
|
+
'business_connection',
|
|
45
|
+
'pre_checkout_query',
|
|
46
|
+
]),
|
|
38
47
|
drop_pending_updates: 'true',
|
|
39
48
|
};
|
|
40
49
|
if (this.secretToken) {
|