Answer the question
In order to leave comments, you need to log in
Autodonate connection?
In general, I wanted to implement an auto-donate in the VKontakte bot. Wrote sample code, but something went wrong. The code:
function donateLink(options) {
let payId = options.id;
let Field1 = options.field1;
let Field2 = options.field2;
let secretKey = 'jksfacjc';
let currency = 'RUB';
let merchId = 309922;
let sign = md5(`309922:${options.amount}:jksfacjc:RUB:tovar`);
const url = `https://www.free-kassa.ru/merchant/cash.php?oa=${options.amount}&i=&m=${merchId}&go_2pay=1&wt=v3&form_id=1686450&s={sign}`;
return url;
}
updates.hear(/^(?:тест донат)\s(.*)?/i, async message => {
let don_currency = donateLink
let currencyy = await vk.api.utils.getShortLink({ url: donateLink });
return message.send(`Вы покупаете ${message.$match[1]} печенек\n\n Ссылка для оплаты ${currencyy.short_url}`)
});
function donateLink(options) {
let payId = options.id;
let Field1 = options.field1;
let Field2 = options.field2;
let secretKey = 'jksfacjc';
let currency = 'RUB';
let merchId = 309922;
let sign = md5(`309922:${options.amount}:jksfacjc:RUB:tovar`);
const url = `https://www.free-kassa.ru/merchant/cash.php?oa=${options.amount}&i=&m=${merchId}&go_2pay=1&wt=v3&form_id=1686450&s={sign}`;
return url;
}
updates.hear(/^(?:тест донат)\s(.*)?/i, async message => {
let don_currency = donateLink
let currencyy = await vk.api.utils.getShortLink({ url: don_currency});
return message.send(`Вы покупаете ${message.$match[1]} печенек\n\n Ссылка для оплаты ${currencyy.short_url}`)
});
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