Payment Telegram Stars #1221
an-vadim-an
started this conversation in
General
Replies: 1 comment
-
Мне кажется это еще не реализовано. Последняя версия Telegram Bot API 7.4 Оплата в звездах появилась в 7.9, нет? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. I wanted to add payment with Telegram Stars, but I always get an error. How can I fix it?
bot.onText(//donate/, (msg) => {
const chatId = msg.chat.id;
});
bot.on('pre_checkout_query', (query) => {
bot.answerPreCheckoutQuery(query.id, true);
});
bot.on('successful_payment', (msg) => {
const chatId = msg.chat.id;
bot.sendMessage(chatId, 'Спасибо за ваш донат! Ваш вклад поможет развитию проекта.');
});
EROR in Console:
Unhandled rejection Error: ETELEGRAM: 400 Bad Request: parameter "currency" is required
at C:\Users\Tulopex\Desktop\NoPracticeLifeBot\node_modules\node-telegram-bot-api\src\telegram.js:316:15
at tryCatcher (C:\Users\Tulopex\Desktop\NoPracticeLifeBot\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\Tulopex\Desktop\NoPracticeLifeBot\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (C:\Users\Tulopex\Desktop\NoPracticeLifeBot\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (C:\Users\Tulopex\Desktop\NoPracticeLifeBot\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (C:\Users\Tulopex\Desktop\NoPracticeLifeBot\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (C:\Users\Tulopex\Desktop\NoPracticeLifeBot\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (C:\Users\Tulopex\Desktop\NoPracticeLifeBot\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (C:\Users\Tulopex\Desktop\NoPracticeLifeBot\node_modules\bluebird\js\release\async.js:102:5)
at Async.drainQueues [as _onImmediate] (C:\Users\Tulopex\Desktop\NoPracticeLifeBot\node_modules\bluebird\js\release\async.js:15:14)
at process.processImmediate (node:internal/timers:483:21)
Beta Was this translation helpful? Give feedback.
All reactions