|
@@ -277,7 +277,7 @@ shadowman.events.on('telegram_update', function(update) {
|
|
|
|
|
|
|
|
// ── Tools ──────────────────────────────────────────────────────────────
|
|
// ── Tools ──────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
-shadowman.tools.register('telegram_send_message', function(args) {
|
|
|
|
|
|
|
+shadowman.tools.register('send_message', function(args) {
|
|
|
if (!args.chat_id) return { success: false, error: 'chat_id is required' };
|
|
if (!args.chat_id) return { success: false, error: 'chat_id is required' };
|
|
|
if (!args.text) return { success: false, error: 'text is required' };
|
|
if (!args.text) return { success: false, error: 'text is required' };
|
|
|
|
|
|
|
@@ -289,7 +289,7 @@ shadowman.tools.register('telegram_send_message', function(args) {
|
|
|
return sanitizeResponse(apiCall('sendMessage', params));
|
|
return sanitizeResponse(apiCall('sendMessage', params));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-shadowman.tools.register('telegram_send_to_owner', function(args) {
|
|
|
|
|
|
|
+shadowman.tools.register('send_to_owner', function(args) {
|
|
|
if (!args.text) return { success: false, error: 'text is required' };
|
|
if (!args.text) return { success: false, error: 'text is required' };
|
|
|
if (!AUTHORIZED_USER_ID) return { success: false, error: 'authorized_user_id not configured' };
|
|
if (!AUTHORIZED_USER_ID) return { success: false, error: 'authorized_user_id not configured' };
|
|
|
|
|
|
|
@@ -299,7 +299,7 @@ shadowman.tools.register('telegram_send_to_owner', function(args) {
|
|
|
return sanitizeResponse(apiCall('sendMessage', params));
|
|
return sanitizeResponse(apiCall('sendMessage', params));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-shadowman.tools.register('telegram_send_photo', function(args) {
|
|
|
|
|
|
|
+shadowman.tools.register('send_photo', function(args) {
|
|
|
if (!args.chat_id) return { success: false, error: 'chat_id is required' };
|
|
if (!args.chat_id) return { success: false, error: 'chat_id is required' };
|
|
|
if (!args.photo) return { success: false, error: 'photo is required' };
|
|
if (!args.photo) return { success: false, error: 'photo is required' };
|
|
|
|
|
|
|
@@ -310,7 +310,7 @@ shadowman.tools.register('telegram_send_photo', function(args) {
|
|
|
return sanitizeResponse(apiCall('sendPhoto', params));
|
|
return sanitizeResponse(apiCall('sendPhoto', params));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-shadowman.tools.register('telegram_send_document', function(args) {
|
|
|
|
|
|
|
+shadowman.tools.register('send_document', function(args) {
|
|
|
if (!args.chat_id) return { success: false, error: 'chat_id is required' };
|
|
if (!args.chat_id) return { success: false, error: 'chat_id is required' };
|
|
|
if (!args.document) return { success: false, error: 'document is required' };
|
|
if (!args.document) return { success: false, error: 'document is required' };
|
|
|
|
|
|
|
@@ -321,7 +321,7 @@ shadowman.tools.register('telegram_send_document', function(args) {
|
|
|
return sanitizeResponse(apiCall('sendDocument', params));
|
|
return sanitizeResponse(apiCall('sendDocument', params));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-shadowman.tools.register('telegram_forward_message', function(args) {
|
|
|
|
|
|
|
+shadowman.tools.register('forward_message', function(args) {
|
|
|
if (!args.chat_id) return { success: false, error: 'chat_id is required' };
|
|
if (!args.chat_id) return { success: false, error: 'chat_id is required' };
|
|
|
if (!args.from_chat_id) return { success: false, error: 'from_chat_id is required' };
|
|
if (!args.from_chat_id) return { success: false, error: 'from_chat_id is required' };
|
|
|
if (!args.message_id) return { success: false, error: 'message_id is required' };
|
|
if (!args.message_id) return { success: false, error: 'message_id is required' };
|
|
@@ -333,27 +333,27 @@ shadowman.tools.register('telegram_forward_message', function(args) {
|
|
|
}));
|
|
}));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-shadowman.tools.register('telegram_get_me', function() {
|
|
|
|
|
|
|
+shadowman.tools.register('get_me', function() {
|
|
|
return sanitizeResponse(apiCall('getMe', {}));
|
|
return sanitizeResponse(apiCall('getMe', {}));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-shadowman.tools.register('telegram_get_chat', function(args) {
|
|
|
|
|
|
|
+shadowman.tools.register('get_chat', function(args) {
|
|
|
if (!args.chat_id) return { success: false, error: 'chat_id is required' };
|
|
if (!args.chat_id) return { success: false, error: 'chat_id is required' };
|
|
|
return sanitizeResponse(apiCall('getChat', { chat_id: args.chat_id }));
|
|
return sanitizeResponse(apiCall('getChat', { chat_id: args.chat_id }));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-shadowman.tools.register('telegram_set_webhook', function(args) {
|
|
|
|
|
|
|
+shadowman.tools.register('set_webhook', function(args) {
|
|
|
if (!args.webhook_url) return { success: false, error: 'webhook_url is required' };
|
|
if (!args.webhook_url) return { success: false, error: 'webhook_url is required' };
|
|
|
var params = { url: args.webhook_url, allowed_updates: ['message', 'edited_message', 'callback_query'] };
|
|
var params = { url: args.webhook_url, allowed_updates: ['message', 'edited_message', 'callback_query'] };
|
|
|
if (args.secret_token) params.secret_token = args.secret_token;
|
|
if (args.secret_token) params.secret_token = args.secret_token;
|
|
|
return sanitizeResponse(apiCall('setWebhook', params));
|
|
return sanitizeResponse(apiCall('setWebhook', params));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-shadowman.tools.register('telegram_delete_webhook', function() {
|
|
|
|
|
|
|
+shadowman.tools.register('delete_webhook', function() {
|
|
|
return sanitizeResponse(apiCall('deleteWebhook', {}));
|
|
return sanitizeResponse(apiCall('deleteWebhook', {}));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-shadowman.tools.register('telegram_get_webhook_info', function() {
|
|
|
|
|
|
|
+shadowman.tools.register('get_webhook_info', function() {
|
|
|
return sanitizeResponse(apiCall('getWebhookInfo', {}));
|
|
return sanitizeResponse(apiCall('getWebhookInfo', {}));
|
|
|
});
|
|
});
|
|
|
|
|
|