Answer the question
In order to leave comments, you need to log in
The bot does not send a notification (message) about the creation of a promotional code?
vk.updates.hear(/^(?:--addpromo)\s?([0-9]+)?/i, async (message) => {
let user = acc.users[user_id(message.user)];
if(user.level < 5) return message.send(`доступно с привилегии "Спец админ"`);
if(!message.$match[1]) return message.send(` » Укажите сумму для промокода`);
var result = '';
let words = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM';
let max_position = words.length - 1;
for( i = 0; i < 6; ++i ) {
position = Math.floor ( Math.random() * max_position );
result = result + words.substring(position, position + 1);
}
acc.promos[result] = {
users: {},
activ: 30,
type: 1,
balance: message.$match[1]
}
await message.send(`ваш промокод создан`)
return vk.api.call('message.send', {chat_id: 22, message:
`» Ловите промокод:\n » На 30 активаций | На ${message.$match[1]}₽\n » Введите: '!промокод ${result}'`
});
});
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