Add files via upload

This commit is contained in:
Fernando Méndez 2021-03-10 21:00:45 +01:00 committed by GitHub
parent 14ee1a428b
commit 44ace42c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 6 deletions

View File

@ -223,23 +223,46 @@ function updateUsers(){
function indexOfArray(_user){ function indexOfArray(_user){
var encontrado = false; var encontrado = false;
var index = 0; var index = -1;
var i = 0; var i = 0;
if(_users.length === 0){ if(_users.length === 0){
index = -1; index = -1;
} else { } else {
while(!encontrado && i < _users.length){ do{
index = _users.findIndex(function (_user) { if(_users[i].id === _user.id){
if(i > 0) return _users[i].id === _user.id; index = i;
}); }
if(index != -1){ if(index != -1){
encontrado = true; encontrado = true;
} else { } else {
i++; i++;
} }
} } while(!encontrado && i < _users.length);
} }
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 ;
}
});
*/