Questions tagged [telegraf.js]

Telegraf is a Node.js library that makes it simple for you to develop Telegram bots using JavaScript or TypeScript.

Telegraf is a Node.js library that makes it simple for you to develop Telegram bots using JavaScript or TypeScript.

Homepage: https://telegraf.js.org

59 questions
4
votes
2 answers

How to know telegram web app opened from an inline button, was closed?

I successfully open a web app using an in-line button from my Telegram bot. When the "work" is complete in the web app, it persists the data to a DB via an API call and then closes itself (the web app) using Telegram.WebApp.close(). Upon the closing…
Gerhardvr
  • 101
  • 5
4
votes
1 answer

How to change the width of inline buttons to chat width, instead of message width

I've seen a bot that has inline buttons across the whole chat area, not dependant on the button's text width): For some reason my buttons are drawn differently, and the text inside the buttons gets trimmed. I don't see a parameter I can pass to…
vladli
  • 1,454
  • 2
  • 16
  • 40
3
votes
2 answers

Alternative of ctx.updateSubTypes Telgraf 4

That end point was removed with new version of telgraf https://github.com/telegraf/telegraf/releases/tag/v4.0.0#:~:text=ctx.updateSubTypes How we can detect the message type with new API this is the old ctx retrun
Hasan Tezcan
  • 1,116
  • 1
  • 11
  • 23
3
votes
3 answers

can't create telegram bot using telegraf package

I'm trying to create a telegram bot using telegraf I read its documentation and I just wanted to start coding using their own examples this is the example provided in documentation: const { Telegraf } = require('telegraf') const bot = new…
amir yeganeh
  • 647
  • 3
  • 11
  • 23
3
votes
2 answers

How to use telegraf webhook?

I want to use webHook in telegraf but i don't know how can i use it correctly. Here is my simple code. But it still uses polling. const Telegraf = require('telegraf'); const bot = new Telegraf('123:ABC'); …
developer
  • 170
  • 2
  • 12
2
votes
1 answer

How to create a Scene and a Stage using telegraf v4 in node js?

My problem is that there is not much information about making a Scene and Stage with Telegraf in node js, I mean Telegraf version 4. I searched a bit on the internet and found some documentation, but all of them are for version 3, not for later…
user20459171
2
votes
1 answer

How to handle contactRequest in Telegraf

so am making a telegram bot using Telegraf.js in Node and the bot requires the user's phone number and in Telegraf one way of requesting phone number is like this ctx.reply( "Phone number is required", { ...Markup.keyboard([ …
boom pow
  • 181
  • 9
2
votes
1 answer

How to disable Telegraf.js inline keyboard after one click

I just started using Telegraf to make a Telegram bot with node, and the bot uses an inline keyboard for users to select from a given option. But after the user selects one option and gets a response, the user can still click on the other options and…
boom pow
  • 181
  • 9
2
votes
1 answer

telegraf.js: banChatMember() with custom chatId

I'm implementing moderation features for a telegram bot, part of it is that the bot should be able to ban a user from multiple groups / channels. I implemented a command that adds the group it was issued in to a moderatedChats.json, which is just a…
2
votes
1 answer

Telegraf bot.action does not catch callbacks

I use example from documentation: bot.command('inline', (ctx) => { return ctx.reply('Coke or Pepsi?', { parse_mode: 'HTML', ...Markup.inlineKeyboard([ Markup.button.callback('Coke', 'Coke'), …
2
votes
2 answers

How to use template engine without using any controller in standalone NestJS Application?

I'm trying to create telegram chatbot application using nestjs-telegraf And then I've idea to use template engine like what has been taught from here, to render the reply message for each message has been received. But, I don't find any way how to…
Ivan Elianto
  • 432
  • 5
  • 19
2
votes
0 answers

Telegram Bot webhook URL gets cleared after couple requests

I created my Telegram Bot and got my token. I prepared my Bot logic on Firebase Functions with Telegraf.js library. I set my webhook using setWebhook When I test my my Telegram Bot, it works fine but after couple requests the Webhook gets…
malhobayyeb
  • 2,725
  • 11
  • 57
  • 91
1
vote
0 answers

Pulling data with telegraf nodejs and outputting it as html

i want to share my data with ascii table but it does not show any results when i try to do it my code con.query(`SELECT * FROM illegalplatform_hackerdede1_gsm WHERE gsm="${mars}"`, function (err, result) { let data =…
mars0j
  • 27
  • 4
1
vote
1 answer

the variable changes for all Telegraf.js users

I am developing a language selection function for my telegram bot written in telegraf.js, language variable changes for all users and this needs to be fixed bot.start(async (ctx) => await ctx.reply("Выберете язык / Choose language: ",{ …
1
vote
1 answer

how to create a chat menu button in telegrafjs

im creating a telegram bot using nodejs and telegrafjs i want to know how to create this menu button i cant find anywhere in documents. it opens up a menu like this one
MiLaD A
  • 149
  • 2
  • 14
1
2 3 4