UNPKG

512 BJavaScriptView Raw
1/**
2 * If running on Nodejs 5.x and below, we load the transpiled code.
3 * Otherwise, we use the ES6 code.
4 * We are deprecating support for Node.js v5.x and below.
5 */
6const majorVersion = parseInt(process.versions.node.split('.')[0], 10);
7if (majorVersion <= 5) {
8 const deprecate = require('depd')('node-telegram-bot-api');
9 deprecate('Node.js v5.x and below will no longer be supported in the future');
10 module.exports = require('./lib/telegram');
11} else {
12 module.exports = require('./src/telegram');
13}