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
1
vote
1 answer

How to edit a last bot send

I need to edit the last message from bot. But I don't know how get ID of last sended messade. This code bot.hears('hi', async (ctx) =>{ try{ await ctx.reply('hello') ctx.editMessageText(ctx.from.id, ctx.from.message.id, "second text") …
1
vote
1 answer

404 error using Telegraf webhook for a bot

I'm trying to make a Telegram bot working, and I'm using Telegraf.js. I've set up a webhook by adding a subdomain to my domain name with a default Apache VirtualHost. It's basically working but for a reason I've got a 404 error from the Telegram's…
1
vote
1 answer

Telegraf.js custom keyboard how to make a Back button?

I don't know how to return to the previous menu by clicking to Back button. bot.command('course', ctx => { ctx.replyWithHTML('Courses', Markup.keyboard( [ ['Editors', 'Reviews'], ['JS'] ] …
1
vote
0 answers

Telegraf.js does not display some thumbnails in the audio media

By some query, using ytsr I get information about the video (link, thumbnail, etc). Then, using ytdl-core, I download the audio of this video and return the cropped thumbnail (320x320 - telegram thumbnail standards) When trying to send an audio…
1
vote
0 answers

Telegram - telegraf hide inline keyboard for non admin roles

How to limit access so the inline buttons don't show up for all users in a group? If it's not possible, what's the best alternative to allow admins to click which sends a command in the chat as the admin himself replying or posting. Either only the…
1
vote
1 answer

Telegraf: After restricting permissions, my bot won't grant posting abilities back

I'm struggling to understand where I've gone wrong here so I'm looking for some extra eyes. I'm using Telegraf to make a Telegram bot in NodeJS. When a new user logs in, it should restrict them from being able to post anything until they answer a…
boydster
  • 31
  • 5
1
vote
1 answer

How to Disable link preview in telegraf

I can not find in the docs how to disable the annoying link preview. Anyone knows how to? const { Extra} = require('telegraf') bot.reply('Hello http://github.com', Extra.webPreview(false)) I have tried above code but showing Extra as…
1
vote
2 answers

How to open URL's using telegraf JS markup inline keyboard in telegram in app browser?

Code Snippet: ctx.reply( `Hi! ${ctx.from.first_name} \n \n Shall we start? `, Markup.inlineKeyboard( [ Markup.button.url( "Covid-19 IN", "https://www.covid19india.org/" ), …
1
vote
1 answer

Telegram bot with telegraf.js : can't send random photo to chat using flickr api

I am a newbie in telegram bots creation and want to make a simple bot which allows a user to choose between a singer or actor photo in the commands and then using the flickr API send it to the chat: const Telegraf = require('telegraf') const {…
1
vote
1 answer

How to handle long messages in Telegraf

I'm trying to send a super long text as a message after clicking the Telegraf Markup callback button. But I got Error: 400: Bad Request: message is too long I am new to Telegraf. Is there any way how to handle it? I will be glad to any advice.
1
vote
1 answer

Telegraf.js pass data from button to a function that handle a WizardScene

I need to pass some data retrieved from a Database. When i click into a button i send a private message to the user who have cliecked. I need to pass some datas from that button, to the message sent. Because, into that message i have an other button…
Matt
  • 127
  • 1
  • 13
1
vote
1 answer

Telegraf.js add buttons with markup on sendPhoto

I've a bot.telegram.sendPhoto() with this code: bot.telegram.sendPhoto( channel_id, {source: filepath}, { caption: description.join("\n"), parse_mode: 'MarkdownV2' } ) (description is an array with some text. So i would to add…
Mattia
  • 199
  • 1
  • 1
  • 12
1
vote
1 answer

how to use Telegram official api inside telegraf library

I'm trying to create a telegram bot using telegraf library and npm and the problem is I can't find a way to use all telegram methods like channels.getFullChannel or channels.getMessages inside telegraf api... there are methods in telegram official…
1
vote
1 answer

How to send image from local folder with telegram bot?

I'm making telegram bot on nodeJs and I failed trying to find information on how to send local photo with bot. Official documentation says "upload a new photo using multipart/form-data". What does that mean ? If you now a better way of sending…
user8174006
1
vote
1 answer

start telegraf scene only by command using telegraf.js

I'm trying to start some scene only by exact command /start I'm using Telegraf.js library that's not going well when I do middleware it starts automatically when I send some other input and not just /start how can I solve it?…
Oshrr Hagag
  • 21
  • 1
  • 3