Class Tg
Entry point for the Telegram fluent DSL.
// Consumer (long polling)
From(Tg.Receive(token))
// Producer (text message)
.To(Tg.Send(token).ChatId(chatId).ParseMode("HTML"))
// Producer (document)
.To(Tg.Document(token).ChatId(chatId).FileName("report.pdf").Caption("Daily report"))
public static class Tg
Inheritance
Methods
Answer()
Callback-answer producer; token supplied by .ConnectionFactory(name).
public static TgBuilder Answer()
Answer(IExpression)
Answers a callback query using an expression token.
public static TgBuilder Answer(IExpression token)
Answer(string)
Answers a callback query (removes the loading spinner on an inline button).
public static TgBuilder Answer(string token)
Delete()
Delete-message producer; token supplied by .ConnectionFactory(name).
public static TgBuilder Delete()
Delete(IExpression)
Deletes a message using an expression token.
public static TgBuilder Delete(IExpression token)
Delete(string)
Deletes a message. Requires headers telegram.chatId
public static TgBuilder Delete(string token)
Document()
Document producer; token supplied by .ConnectionFactory(name).
public static TgBuilder Document()
Document(IExpression)
Creates a document producer with expression token.
public static TgBuilder Document(IExpression token)
Document(string)
Creates a document producer endpoint (body must be Stream or byte[]).
public static TgBuilder Document(string token)
Download()
File-download producer; token supplied by .ConnectionFactory(name).
public static TgBuilder Download()
Download(IExpression)
Downloads a file using an expression token.
public static TgBuilder Download(IExpression token)
Download(string)
Downloads a file the user sent; the bytes land in Out.Body as a byte[].
public static TgBuilder Download(string token)
Edit()
Edit-message producer; token supplied by .ConnectionFactory(name).
public static TgBuilder Edit()
Edit(IExpression)
Edits an existing message using an expression token.
public static TgBuilder Edit(IExpression token)
Edit(string)
Edits the text (and optionally markup) of an existing message.
public static TgBuilder Edit(string token)
Photo(IExpression)
Creates a photo producer with expression token.
public static TgBuilder Photo(IExpression token)
Photo(string)
Creates a photo producer endpoint (body must be Stream or byte[]).
public static TgBuilder Photo(string token)
Receive()
Long-polling consumer; token supplied by .ConnectionFactory(name).
public static TgBuilder Receive()
Receive(IExpression)
Creates a long-polling consumer with expression token.
public static TgBuilder Receive(IExpression token)
Receive(string)
Creates a long-polling consumer endpoint.
public static TgBuilder Receive(string token)
Send()
Text message producer; token supplied by .ConnectionFactory(name).
public static TgBuilder Send()
Send(IExpression)
Creates a text message producer with expression token.
public static TgBuilder Send(IExpression token)