Comments (3)
Hi @CryptoCarlos21
You should use Key.callback
as button
Simple example:
const { Keyboard, Key } = require('telegram-keyboard')
Keyboard.inline([
Key.callback('Key title', 'answer')
])
But keep in mind this only works for inline keyboard
from telegram-keyboard.
Thank you, it works, I'm customizing the messaging now.
so if I have the following code, the bot replies with this. See the reply contains "/play" which is a group command. how can I make it that the bot sends this message as the user instead so it will trigger my other bot to play the track?
Right now I have 2 bots, 1 that plays music fine once users use the /play and a youtube url
This new bot I'm trying to have buttons instead of users having to manually type the command. So button 1 would be a track I configured
const keyboard = Keyboard.make([
[Key.callback('1st track', '/play https://www.youtube.com/watch?vxxxxxxx').inline()
bot.on('callback_query', (ctx) => {
return ctx.reply(ctx.callbackQuery.data)
})
return ctx.reply('All audio files', keyboard)
})```
from telegram-keyboard.
You cannot make the bot send a message on behalf of the user
from telegram-keyboard.
Related Issues (20)
- Unhandled error while processing update HOT 7
- SyntaxError: Unexpected token = HOT 3
- double click on inline buttons
- [HW/FR] Add mobile phone/current location request with callback HOT 5
- How to add one_time_keyboard field in Reply Keyboard HOT 3
- I have implemented an inline keyboard in my bot, but when I click on the button, the message with what is written on the button is not sent. HOT 1
- How to use HTML or Markdown HOT 1
- Write a good README
- Add more interesting examples
- How i can add "one_time_keyboard" option? HOT 1
- Limit access to admins only HOT 3
- Cannot deploy to heroku HOT 1
- Disable notifications from inline replies HOT 1
- Update options HOT 1
- Migrate to TypeScript HOT 1
- Buttons that open app on mobile HOT 1
- you have video for how to use this bot ?
- Keyboard as command
- customizing the buttons HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegram-keyboard.