realpeha / telegram-keyboard Goto Github PK
View Code? Open in Web Editor NEWSimple and powerful keyboard builder for Telegram Bots
Home Page: https://www.npmjs.com/package/telegram-keyboard
Simple and powerful keyboard builder for Telegram Bots
Home Page: https://www.npmjs.com/package/telegram-keyboard
Hi, I am not sure if this is the place to ask this, but if is not it would be great if you can help me clarifying this issue.
I have a telegram bot and I need to create a button that when the user tap on it it should open a mobile app, when I do this on a HTML site I add on an anchor tag this href
href = "lightning:lnbc60n1p3yyvn6pp5yx2eycreyxuxy048v4cf9305vmhtdhk23kxk0tp6xtd39r64mkcsdpl2pshjmt9de6zqen0wgsrvgrsd9ux2mrnypshggrnv96x7umgd9ejuurvv93k2tsxqzjccqpjsp5p9lyqyu3fskh9zzjldyq2zgdrmh9thzcjpr8zeun6hjk9sy99y5qrzjqfyyyppkypkukp3nrql8kektwzp6vcf4j9n7w8f8c5axh3me6ktsvzj0w5qqztcqqqqqqqryqqqqqqgq9q9qyyssqs0gspkcm8dqw2gh358yygjg8kav5rlg5u7d0rgejmqkc9k9t2xvq7p7pwu08ff3m275t39rdc9888vw8ht7hy8u883wcvcymvwe0tnsputm7w6"
I tried to do it on a inline button with url
but it doesn't work.
Is it posible to create buttons with custom styles, like background color or font color, etc?
How do I add HTML formatting or Markdown?
It will be very helpful if this plugin can ask a user for giving a phone number or current location.
Is it possible to implement this feature?
PS: HW - help wanted, FR - feature request
Request to enhance the tool so each inline reply does not trigger a new notification in telegram.
I want to add one_time_keyboard : true
in Reply Keyboard.
I want the button title to be different to the reply it posts
Hello. In 5.3 bot api version added "input_field_placeholder". Please add this
https://core.telegram.org/bots/api#replykeyboardmarkup
How to make keyboard as command and then i can pass it seems like slash ex. /help
Hello,
I made inline menu with telegram-keyboard library.
I have a button in every step that will back to pervious step.
Its action is when user clicked on it will remove current menu( deleteMessage() method ) and will print pervious menu.
But if user double click on button i will receive this error: 'Bad Request: message to delete not found'.
I also have this problem with the other buttons.
Is there any solution to fix this problem?
I have this running fine locally but when i try to deploy to heroku the modules won't work.
Is there a different package.json configuration needed to work with heroku?
2021-11-18T17:18:54.547748+00:00 app[web.1]: Require stack:
2021-11-18T17:18:54.547749+00:00 app[web.1]: - /app/index.js```
I am following simple keyboard given here: https://github.com/RealPeha/telegram-keyboard/blob/master/examples/telegraf/simple.js
I am deploying my bot on AWS lamda using serverless framework that's why I am using telegraf-aws
module.
The webhook gets triggered when I send message to the bot but it ends up in an error.
The code looks very simple but still not working. Here is my code:
"use strict";
const token = process.env.BOT_TOKEN;
if (!token) {
throw new Error("BOT_TOKEN must be provided!");
}
const { Telegraf } = require("telegraf");
const telegrafAWS = require("telegraf-aws");
const bot = new Telegraf(token, {
telegram: {
webhookReply: true,
},
});
const handler = telegrafAWS(bot, {
timeout: 3000,
});
const { Keyboard } = require("telegram-keyboard");
const mainMenuKeyboard = Keyboard.make([
["Main menu", "Inline Menu"],
["Help"],
]).reply();
bot.start(({ reply }) => {
return reply("Simple Keyboard", mainMenuKeyboard);
});
module.exports = { handler };
And here is the error
2021-01-26 17:56:17.857 (+05:00) ba407db1-3a49-4553-b3ff-1afb6dd8fcd1 ERROR Unhandled error while processing {
update_id: 158445257,
message: {
message_id: 150,
from: {
id: 935285759,
is_bot: false,
first_name: 'Abdul',
last_name: 'Fatah',
username: 'abdulfatah66',
language_code: 'en'
},
chat: {
id: 935285759,
first_name: 'Abdul',
last_name: 'Fatah',
username: 'abdulfatah66',
type: 'private'
},
date: 1611665763,
text: '/start',
entities: [ [Object] ]
}
}
Please help. Thanks
How to limit access so the buttons don't show up for all users.
Either only the user currently pressing the buttons or all admins?
Hello, I'm trying to use the library and nodejs is returning the following error:
/my-project/node_modules/telegram-keyboard/lib/keyboard.js:12
static defaultOptions = {
^
SyntaxError: Unexpected token =
I already searched a lot but I didn't find anything like that, do you know what it can be?
How can I keep my new .added option in the keyboard to a newline?:
const options = {
inline: false, // default
duplicates: false, // default
newline: true
};
const keyboard2 = new Keyboard(options);
keyboard2
.add("Athletic", "Alavés", "Atlético", "Barcelona")
.add("Betis", "Espanyol", "Getafe", "Granada");
ctx.reply(
"I know stuff. Choose any two teams and I'll tell you its past games",
keyboard2.draw()
);
keyboard2.remove(${msg}
);
keyboard2.add(${teamSelected[0]}
);
I display 8 teams to the User and ask the user to choose a Team, and then I remove it, so the user can only choose a rival between the remaining 7 teams. But on a new iteration after he chooses this second team, I want to reenter the first team removed. How can I enter it as a newline?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.