UNPKG

telebot

Version:

The easy way to write Telegram bots.

20 lines (19 loc) 540 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const messageTypes = [ "text", "photo", "document" ]; exports.updateProcessors = { message(messageUpdate) { const processorPromises = []; for (const messageType of messageTypes) { if (messageType in messageUpdate) { processorPromises.push(this.dispatch(messageType, messageUpdate)); break; } } return Promise.resolve(Promise.all(processorPromises)); } };