tock / ai.tock.bot.connector.messenger / withMessenger

# withMessenger

`fun <T : Bus<T>> T.withMessenger(messageProvider: () -> MessengerConnectorMessage): T` (source)

Adds a Messenger ConnectorMessage if the current connector is Messenger. You need to call T:BusT.send or T:BusT.end later to send this message.

`fun <T : Bus<T>> T.withMessenger(connectorId: String, messageProvider: () -> MessengerConnectorMessage): T` (source)

Adds a Messenger ConnectorMessage if the current connector is Messenger and the current connector is connectorId. You need to call T:BusT.send or T:BusT.end later to send this message.