Comments (1)
Your example @tieudat is not a full example... So normal that dont works, you dont create a instance. Only import the api, but you need to use it.
This is basic example:
// Import the library
const TelegramBot = require('node-telegram-bot-api');
// Replace the value below with the Telegram token you receive from @BotFather
const token = 'YOUR_TELEGRAM_BOT_TOKEN';
// Create bot that uses 'polling' to fetch new updates
const bot = new TelegramBot(token);
// Now call the function
const title = 'Invoice link product';
const description = 'Our test invoice link product';
const payload = 'sku-p002';
const providerToken = XXXXX.....; // Token of your payment provider get it form botfather bot config
const currency = 'EUR';
const prices = [{ label: 'NTBA API', amount: 12000 }, { label: 'tax', amount: 10000 }];
bot.createInvoiceLink(title, description, payload, providerToken, currency, prices).then(resp => {
console.log("Invoice Link", resp)
});
from node-telegram-bot-api.
Related Issues (20)
- how to create sticker with pack, i'm new with this library so i got many error while trying
- sendMediaGroup - InputMediaDocument HOT 2
- question how to save photos by reply HOT 1
- multiple upload file HOT 1
- bot.on('message', ...) works unexpected
- Occasionally not receiving message update
- Listening for a reply to an image with the '/isimage' command, replying with a message saying 'this is an image' HOT 1
- Deleting old message IDs in Telegram
- Add to sendInvoice start_parameter HOT 2
- Pre-Checkout Timeout Error while making a Payment HOT 5
- The editMessageMedia method is working a bit wrong
- The 'Update' object sometimes does not have an attribute 'reply_to_message' in private messages
- Webhook setup via URL returns blank
- Business Mode HOT 6
- please help me i got this error HOT 1
- Bot replys to user no problem, but when i want it to send announchment to channel or group. nothing happens
- I have problem. I have more than 1,500 users, and the bot checks the site if products are available and sends for All the users if they are available. I set that it checks the site every 50 seconds so that the users can get the notification before the stock runs out, but I faced a problem, which is that it is very late. In the transmitter
- Bot occasionally doesn't receive update
- I always get 401 unauthorized error when use test bot HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-telegram-bot-api.