# Keyboard

Traditional chat bots can of course be taught to understand human language. But sometimes you want some more formal input from the user — and this is where **custom keyboards** can become extremely useful.

Whenever your bot sends a message, it can pass along a special keyboard with predefined reply options (see [ReplyKeyboardMarkup](https://core.telegram.org/bots/api#replykeyboardmarkup)). Telegram apps that receive the message will display your keyboard to the user. Tapping any of the buttons will immediately send the respective command. This way you can drastically simplify user interaction with your bot.

#### Keyboard <a href="#keyboard" id="keyboard"></a>

Below is the illustration of how a keyboard looks like.

```javascript
const keyboard = new Keyboard()
.text("A").text("B").row()
.text("C").text("D");​
Bot.reply("Worked", {
reply_markup: keyboard,
});
```

#### Inline Keyboard <a href="#inline-keyboard" id="inline-keyboard"></a>

Here is an example on how to send an inline keyboard in MateBot Script.

```javascript
const inlineKeyboard = new InlineKeyboard()
.text("Human", "/human")
.text("Bot", "/bot");​​


Bot.reply("What are you?", {
reply_markup: inlineKeyboard
});
```

#### URL Button <a href="#url-button" id="url-button"></a>

A URL button contains a hyperlink which on clicked opens up in a web browser.

An example of a URL button is illustrated in the image below.

```javascript
const inlineKeyboard = new InlineKeyboard().url(
"MateBot Documentation",
"https://matebot-1.gitbook.io/",
);
​
Bot.reply("Click on the button below", {
reply_markup: inlineKeyboard,
});
```

#### Callback button <a href="#callback-button" id="callback-button"></a>

A callback button in an inline keyboard sends a callback query not visible to the user when pressed. You can pass a command name in callback data and the command will be executed.

```javascript
const inlineKeyboard = new InlineKeyboard()
.text("Get random number", "/random").row()

​Bot.reply("Worked", {
reply_markup: inlineKeyboard,
});
```

The above will execute `/random` command when user press the button.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://matebot-app.gitbook.io/untitled/scripting/keyboard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
