KeyboardButtonRequestPeer telegram bot dev #113510
Replies: 2 comments
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Hello @ibnum1, You can use Using node-telegram-bot-api:First, install the library: npm install node-telegram-bot-api Then, create your bot: const TelegramBot = require('node-telegram-bot-api');
// Replace YOUR_TELEGRAM_BOT_TOKEN with your actual bot token
const bot = new TelegramBot('YOUR_TELEGRAM_BOT_TOKEN', { polling: true });
bot.on('message', (msg) => {
const chatId = msg.chat.id;
const keyboard = {
keyboard: [
[
{
text: 'Request User',
request_peer: true // This is equivalent to KeyboardButtonRequestPeer
}
]
],
resize_keyboard: true,
one_time_keyboard: true
};
bot.sendMessage(chatId, 'Click the button to request a user:', {
reply_markup: keyboard
});
}); Replace 'YOUR_TELEGRAM_BOT_TOKEN' with your actual bot token. Without any libraryIf you want to try KeyboardButtonRequestPeer without any library, you can refer to this example: Using KeyboardButtonRequestPeer without libraries. |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
how to use KeyboardButtonRequestPeer, any examples i would prefer them with javascript
Beta Was this translation helpful? Give feedback.
All reactions