Answer the question
In order to leave comments, you need to log in
How to return different messages for different responses?
vk.updates.hear(/^(?:СП)\s?([^]+)?/i, (message) => {
axios.get(`https://minecraft-statistic.net/api/player/info/${message.$match[1]}/182507`).then(res => {
if(res.data && res.data.status) {
let status = res.data.status || 0
}
return message.send(`${status}`);
}).catch(err => message.send(`⚠ Произошла ошибка!\n\n Возможно вы использовали в никнейме русские буквы!\n Если это не так свяжитесь с *egorlisss`));
});
Answer the question
In order to leave comments, you need to log in
If status = ok we return one response, if status = error we return another response
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question