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
0
votes
0 answers

Telegraf.js - using buttons not related to Wizard while in Wizard

I make a telegram bot via Telegraf.js, and faced such problem: I have 4 buttons, one of which starts Wizard Scene. Other 3 buttons (common keyboard, not an inline one) should run some functions, but they do that after second click (first one is to…
0
votes
0 answers

bot.startPolling or bot.launch stopped working after few hours telegraf js (bot not responding or sending any messages)

I have this simple code Telegraf JS bot.command('starttahabot', (ctx) => { ctx.reply('Hello'); }); //bot.launch() bot.startPolling() I tried these two functions, launch and startPolling and after few hours the bot is stopped working and not…
Taha Halabi
  • 155
  • 7
0
votes
0 answers

Step back in WizardScene telegraf

I am having trouble implementing the step system in my WizardScene. I've been trying for 2 days now. System of operation: The bot edits a post each time it receives the data it needs from a user. Required: Ability to go back one step from any step…
David
  • 1
  • 3
0
votes
0 answers

nodejs telegraf.js I get an error when I use the wrong parameters

I am dealing with a bot, I created parameters, but when I use the parameters incorrectly, I get an error instead of doing nothing. bot.command('gsmn', async (ctx) => { var { AsciiTable3, AlignmentEnum } = require('ascii-table3'); var table = …
mars0j
  • 27
  • 4
0
votes
0 answers

How to Add Telegraf Command Parameters?

hello I am writing a telegram bot but I want to add parameters to my commands, for example /command -gsm 921 how do i do the same with telegraf node.js i write my bot I would appreciate your help :)) and I want to specify this parameter, for…
mars0j
  • 27
  • 4
0
votes
0 answers

telegram bot is not sending reply after user clicks on an inline keyboard reply markup, how to make it replay?

i want to replay to user with a message when he clicks on the button, i tried many solution but so far nothing worked, i get the callback_query data after user clicks on the button but the bot is replaying to him im using telegraf js library //…
0
votes
0 answers

Nestjs-telegraf Error: 400: Bad Request: can't ban members in private chats

@On('message') async ban(@Message('text') text: string, @Ctx() ctx: Context) { if (text === '✖️ Отмена') { await ctx.deleteMessage(this.#messageId) await ctx.deleteMessage() await ctx.reply('✔️', adminButtons()) …
Nick17
  • 1
0
votes
0 answers

the ascii table I made with telegram is not working properly

i'm writing a bot using javascript and the telegram module, I want my bot to have an ascii table, but I couldn't manage it, whenever I try, the text doesn't come out correctly, please help, my codes are here this is the text that comes out this my…
mars0j
  • 27
  • 4
0
votes
0 answers

how can retrieve data from telegram bot that's running with webhooks and pass it to an object in node js

so i have this telegram bot, created it with telegraf js library and its running with web hooks, my goal is to retreive the data from the bot and pass the data into an object in my node js. 1- this function is responsible for creating multi web…
0
votes
2 answers

Force change scene of another user in Telegraf.js

I am creating game bot, where user should answer some questions, and admin should approve or reject them. I need to find a way, when admin is accepted the answer, to force change scene of the user. So for example the user is in scene "answering".…
0
votes
0 answers

Display an admin-only inline button in Telegraf.js

I have a telegram shop bot written in Telegraf.js. When a normal user starts the bot I want the people to see only 4 buttons (products, cart, account and info) When instead someone starts the bot and its id is in a config json file I want the bot…
AnonHexo
  • 63
  • 1
  • 5
0
votes
0 answers

how to pass data from text button in Telegraf (Telegram Bot)

I have code like bellow, I have 3 step form which I would like to pass variables from step 1 to step 2 and then step 3. bot.action('BuyService',(ctx)=>{ ctx.deleteMessage() ctx.reply('first step text', { reply_markup: { …
ikolo
  • 1
0
votes
0 answers

Problem with catching Telegram based response/request error 403

I would like to ask is there a way to globally catch all the errors regarding requests/responses that Telegram sends? I have multiple scenes with many answers and dialogue decisions and I can't really think of a better way of catching all the errors…
kapisolec
  • 123
  • 12
0
votes
0 answers

Send viewable Images from Google Drive API to telegram bot using telegraf nodeJs

I've managed to retrieve images from Google Drive using Google drive API. This is the file I've managed to retrieved. This is the code: drive.files.get({fileId: '1z7GeGoxcbtUyGX4vBhR0-KKM-QnwrQhe', fields: "*"},(err, res) => { …
0
votes
0 answers

How to send .txt file from telegram bot using TelegrafJS Framework?

I have a action which will be executed when user clicks on "confirm" btn. superWizard.action("confirm", (ctx) => { if (ctx.session.update === "one") { bot.telegram.sendMessage( ctx.chat.id, // ctx.session.groups[ctx.session.type], …