Update bot.js

This commit is contained in:
Fernando Méndez 2021-03-10 21:01:07 +01:00 committed by GitHub
parent 44ace42c4b
commit 5cb519ae46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ const bot = new TelegramBot(token, {polling:true});
/* Translator */ /* Translator */
//const translate = require('translate-api'); //const translate = require('translate-api');
const translate = require('@vitalets/google-translate-api'); //https://www.npmjs.com/package/@vitalets/google-translate-api const translate = require('@vitalets/google-translate-api');
//const translate = require('google-translate-api'); //const translate = require('google-translate-api');
// To overwrite the users.json file: // To overwrite the users.json file:
@ -243,26 +243,3 @@ function indexOfArray(_user){
return index; return index;
} }
/*
bot.on('callback_query', function onCallbackQuery(accionboton){
const data = accionboton.data;
const msg = accionboton.message;
var chatId = msg.chat.id;
switch(data){
case 'es_en': _from='es'; _to='en';
bot.sendMessage(chatId, "Now I will translate the texts from *Spanish*🇪🇸 to *English*🇬🇧.", {parse_mode: 'Markdown'});
break ;
case 'en_es': _from='en'; _to='es';
bot.sendMessage(chatId, "Now I will translate the texts from *English*🇬🇧 to *Spanish*🇪🇸.", {parse_mode: 'Markdown'});
break ;
case 'es_ru': _from='es'; _to='ru';
bot.sendMessage(chatId, "Now I will translate the texts from *Spanish*🇪🇸 to *Russian*🇷🇺.", {parse_mode: 'Markdown'});
break ;
case 'ru_es': _from='ru'; _to='es';
bot.sendMessage(chatId, "Now I will translate the texts from *Russian*🇷🇺 to *Spanish*🇪🇸.", {parse_mode: 'Markdown'});
break ;
}
});
*/