Class TgKeyboard

Assembly: redb.Route.Telegram.dll

Typed builders for Telegram reply markup (keyboards).

The result is a Telegram.Bot markup object that is placed on the exchange
under — the same header the producer reads.
Use these factories to construct keyboards without referencing
Telegram.Bot.Types.ReplyMarkups directly in route code.


// Static keyboard via the route-extension sugar:
From(Tg.Receive(token))
.SetBody("Choose:")
.WithInlineKeyboard(k => k
.Row(r => r.Callback("✅ Yes", "act:yes").Callback("❌ No", "act:no")))
.To(Tg.Send(token).ChatId(Header(TelegramHeaders.ChatId)));

// Dynamic keyboard inside a processor:
exchange.In.Headers[TelegramHeaders.ReplyMarkup] = TgKeyboard.Inline(k =>
{
foreach (var o in orders) k.Row(r => r.Callback(o.Title, $"order:{o.Id}"));
});

public static class TgKeyboard

Inheritance

Object→TgKeyboard

Methods

Inline(Action<InlineKeyboardBuilder>)

Builds an inline keyboard (callback / URL / web-app buttons attached to the message).

public static InlineKeyboardMarkup Inline(Action<InlineKeyboardBuilder> build)

Remove(bool)

Builds a markup that removes the current custom reply keyboard.

public static ReplyKeyboardRemove Remove(bool selective = false)

Reply(Action<ReplyKeyboardBuilder>)

Builds a reply keyboard (buttons shown below the text input).

public static ReplyKeyboardMarkup Reply(Action<ReplyKeyboardBuilder> build)