Skip to main content

Built and signed on GitHub Actions

Framework-agnostic Telegram bot keyboard builder with many cool features!

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 days ago (1.0.1)
class ForceReplyKeyboard

ForceReply builder

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.

[Documentation]

Properties

options: { isSelective: boolean; placeholder: string | undefined; }

Methods

build(): TelegramForceReply

Return TelegramForceReply as JSON

placeholder(value?: string): this

The placeholder to be shown in the input field when the reply is active; 1-64 characters

selective(isEnabled?: boolean): this

Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.

toJSON(): TelegramForceReply

Serializing a class into an TelegramForceReply object (used by JSON.stringify)

Add Package

deno add jsr:@gramio/keyboards

Import symbol

import { ForceReplyKeyboard } from "@gramio/keyboards";

---- OR ----

Import directly with a jsr specifier

import { ForceReplyKeyboard } from "jsr:@gramio/keyboards";

Add Package

npx jsr add @gramio/keyboards

Import symbol

import { ForceReplyKeyboard } from "@gramio/keyboards";

Add Package

yarn dlx jsr add @gramio/keyboards

Import symbol

import { ForceReplyKeyboard } from "@gramio/keyboards";

Add Package

pnpm dlx jsr add @gramio/keyboards

Import symbol

import { ForceReplyKeyboard } from "@gramio/keyboards";

Add Package

bunx jsr add @gramio/keyboards

Import symbol

import { ForceReplyKeyboard } from "@gramio/keyboards";