Answer the question
In order to leave comments, you need to log in
How to make a loop in try?
You need to make sure that Try: is used several times via args[4]
for example -start host.com 123 123 123 4 ( 4 is how many times requests should be sent )
vk.updates.hear(/-start/, async (context) => {
if(admin.indexOf(context.senderId) === -1) {
return //context.send('Вам не доступна эта команда! @id' + context.senderId)
}
var args = context.message.text.split(' ');
var starts;
args.shift()
try {
var response = await axios.get('?', {
params: {
page: '',
key: '',
host: args[0],
port: args[1],
time: args[2],
method: args[3]
}
})
if(args[3] === '') {
return context.send(' : ' + args[0]')
}
if(!args[0]) {
return
}
if(!args[1]) {
return
}
if(!args[2]) {
return
}
if(!args[3]) {
return
}
return context.send(' : ' + args[0]);
} catch(err) {
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question