Class TelegramProducer
Telegram Bot producer.
Supported modes: send, document, photo, answer, edit, delete, download.
ChatId is resolved (in priority order):
Header telegram.chatId on the exchange
Options.ChatId (from URI or DSL)
The answer and download modes need no chatId: the first is addressed by
callback query id, the second by file id.
On successful send/document/photo/edit the resulting Message.MessageId
is written back to the exchange as header ;
download writes the bytes to Out.Body.
public sealed class TelegramProducer : ConnectableProducer, IProducer, IProcessor
Inheritance
Implements
Inherited Members
Properties
ProducerEndpoint
The endpoint this producer sends to.
protected override IEndpoint ProducerEndpoint { get; }
ProducerName
Display name for logging (e.g. "http:https://api.example.com", "kafka:orders").
protected override string ProducerName { get; }
Methods
ConnectAsync(CancellationToken)
Set up connection/resources. Awaited by Start() to completion before IsStarted flips to
protected override Task ConnectAsync(CancellationToken ct)
DisconnectAsync(CancellationToken)
Tear down connection/resources. Called from Stop() after the started flag is cleared.
protected override Task DisconnectAsync(CancellationToken ct)
Process(IExchange, CancellationToken)
Processes the exchange asynchronously.
public override Task Process(IExchange exchange, CancellationToken ct = default)
Constructors
TelegramProducer(TelegramEndpoint, TelegramEndpointOptions)
Creates a Telegram producer.