* sendTextMessageTo() Just makes it easier to send a text message with * minimal structure. * @param {string} text * @param {string} recipientId a string representing the id of the user to * whom you want to send the message. * @param {object} [sendOptions] see `sendOptions` for `send
(text, recipientId, sendOptions)
| 374 | * bot.sendTextMessageTo('something super important', update.sender.id); |
| 375 | */ |
| 376 | sendTextMessageTo(text, recipientId, sendOptions) { |
| 377 | if (!get(this, 'sends.text')) { |
| 378 | return Promise.reject(new SendMessageTypeError(this.type, 'text')); |
| 379 | } |
| 380 | const outgoingMessage = this.createOutgoingMessage() |
| 381 | .addRecipientById(recipientId) |
| 382 | .addText(text); |
| 383 | |
| 384 | return this.sendMessage(outgoingMessage, sendOptions); |
| 385 | } |
| 386 | |
| 387 | /** |
| 388 | * reply() Another way to easily send a text message. In this case, |
no test coverage detected