Skip to content

UnmaintainedProjects/keyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gotgbot keyboard

Build reply markup keyboards easier than ever.

Installation

go get github.com/gotgbot/keyboard

Docs

go.dev

Example

Inline

import "github.com/gotgbot/keyboard"

...

query := "query"

ctx.Message.Reply(
    b,
    "text",
    &gotgbot.SendMessageOpts{
        ReplyMarkup: new(
            keyboard.InlineKeyboard,
        ).Text(
            "text",
            "callback data",
        ).Url(
            "text",
            "https://github.com/gotgbot/keyboard",
        ).Row(
        ).SwitchInline(
            "text",
            &query,
        ).Build()
    }
)

Reply

import "github.com/gotgbot/keyboard"

...

ctx.Message.Reply(
    b,
    "text",
    &gotgbot.SendMessageOpts{
        ReplyMarkup: new(
            keyboard.Keyboard,
        ).Text(
            "text",
        ).RequestContact(
            "text",
        ).Row(
        ).RequestPoll(
            "text",
            "type",
        ).Build()
    }
)

Credits