19e282453843c5422c5e7c10d7a24b4741feca06
Keyboard Reset Bot
A minimal Telegram bot that removes reply keyboard buttons in Telegram group chats by sending a keyboard reset message.
Features
- Works only in group chats and supergroups
- Single command:
/resetkeyboard - Admin-only authorization
- Automatically removes its confirmation message after 7 seconds
- Stateless (no database, no data storage)
Setup
-
Get a Bot Token
- Talk to @BotFather on Telegram
- Create a new bot with
/newbot - Copy the bot token
-
Install Dependencies
npm install -
Configure Environment
- Copy
.env.exampleto.env - Add your bot token:
BOT_TOKEN=your_bot_token_here
- Copy
-
Run the Bot
npm start
Usage
- Add the bot to your Telegram group
- Grant the bot "Read messages" permission (and optionally "Delete messages" for cleanup)
- An admin can use
/resetkeyboardto remove all reply keyboards in the group
Requirements
- Node.js 14+ (ES modules support)
- Bot permissions: "Read messages" (required), "Delete messages" (optional)
How It Works
When an admin sends /resetkeyboard in a group:
- The bot verifies the user is an administrator
- Sends a message with
ReplyKeyboardRemove(selective: false) - This resets reply keyboards for all users who receive the message
- The bot deletes its own message after 7 seconds
Notes
- The bot ignores private chats
- Only group administrators can use the command
- The bot is stateless and does not store any data
- If another bot sends a keyboard after reset, it will appear again (expected behavior)
Description
Languages
JavaScript
100%