Is there a better way with NodeJs to get updates from a Telegram bot?
问题 I'm using simply like below: class Bot { constructor(token) { let _baseApiURL = `https://api.telegram.org`; //code here } getAPI(apiName) { return axios.get(`${this.getApiURL()}/${apiName}`); } getApiURL() { return `${this.getBaseApiUrl()}/bot${this.getToken()}`; } getUpdates(fn) { this.getAPI('getUpdates') .then(res => { this.storeUpdates(res.data); fn(res.data); setTimeout(() => { this.getUpdates(fn); }, 1000); }) .catch(err => { console.log('::: ERROR :::', err); }); } } const bot = new