This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // For use: | |
| // 1) npm i telegraf got | |
| // 2) replace TELEGRAM_BOT_TOKEN / YOUTUBE_TOKEN_API / YOUTUBE_VIDEO_ID / GROUP | |
| const { Telegraf } = require('telegraf'); | |
| const got = require('got'); | |
| const URL = 'https://www.googleapis.com/youtube/v3/videos?id=YOUTUBE_VIDEO_ID&key=YOUTUBE_TOKEN_API&part=statistics'; | |
| const GROUP = -0; // telegram group ip, start with -, yes | |
| const TOKEN = 'TELEGRAM_BOT_TOKEN'; |