Back to Blog
BJS (Bots.Business) Interactive Features

Creating Interactive Keyboards in BJS

Interactive Keyboards in BJS

What are Keyboards?

Keyboards allow users to interact with your bot by clicking buttons instead of typing commands. This makes your bot more user-friendly and accessible.

Simple Keyboard Example

JAVASCRIPT
var keyboard = [
    [{text: "🔍 Search", callback_data: "search"}],
    [{text: "📚 Categories", callback_data: "categories"}],
    [{text: "â„šī¸ Help", callback_data: "help"}]
];
Bot.sendInlineKeyboard(keyboard, "What would you like to do?");

Multi-Row Keyboards

JAVASCRIPT
var keyboard = [
    [{text: "đŸ”Ĩ Popular", callback_data: "popular"}, {text: "✨ New", callback_data: "new"}],
    [{text: "📁 Categories", callback_data: "categories"}, {text: "đŸˇī¸ Tags", callback_data: "tags"}],
    [{text: "âš™ī¸ Settings", callback_data: "settings"}]
];
Bot.sendInlineKeyboard(keyboard, "Browse content:");

URL Buttons

JAVASCRIPT
var keyboard = [
    [{text: "📘 Documentation", url: "https://help.bots.business"}],
    [{text: "đŸ’Ŧ Support Chat", url: "https://t.me/botsbusiness"}]
];
Bot.sendInlineKeyboard(keyboard, "Need help?");

📚 Source

This tutorial is based on the official Bots.Business Documentation. Visit their site for the most up-to-date information and advanced guides.

Share this tutorial