Package Exports
- telegram-keyboard
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (telegram-keyboard) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Telegram Keyboard Builder
Simple keyboard builder for Telegram Bots
Installation
Just use npm
npm i telegram-keyboard --save
or yarn
yarn add telegram-keyboard
Example of use in Telegraf
const Telegraf = require('telegraf')
const { Keyboard } = require('telegram-keyboard')
const bot = new Telegraf(process.env.BOT_TOKEN)
bon.on('text', async ({ reply }) => {
const keyboard = Keyboard.make([
['Button 1', 'Button 2'], // First row
['Button 3', 'Button 4'], // Second row
])
await ctx.reply('Simple built-in keyboard', keyboard.builtIn())
await ctx.reply('Simple inline keyboard', keyboard.inline())
})
More examples you may find in example