Answer the question
In order to leave comments, you need to log in
Can't send a message to the conversation that a new promo code has been created?
vk.updates.hear(/^(?:--addpromo)\s?([0-9]+)?/i, 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]
}
return ('message.send', {chat_id: c22,
` » Ловите промокод:\n » На 30 активаций | На ${message.$match[1]}₽\n » Введите: '!промокод ${result}'`);
}});
Answer the question
In order to leave comments, you need to log in
Try like this:
return vk.api.call('message.send', {chat_id: 22,
` » Ловите промокод:\n » На 30 активаций | На ${message.$match[1]}₽\n » Введите: '!промокод ${result}'`);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question