P
P
Pavel M2022-02-18 08:38:35
Node.js
Pavel M, 2022-02-18 08:38:35

Telegrafjs: How to send messages without subscribing to something?

you need the bot to track changes in the local file and immediately send them to telegrams, without waiting for the user to request something

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel M, 2022-02-18
@PavelMelnik94

via node's fs
const fs = require('fs');
fs.watchFile('url-to-file', (curr, prev) => {
// code
bot.telegram.sendMessage(chat-id, message);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question