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

Telegram Bot with Telegraf.js - how consistently collect data

My wizard scene only works after I comment on the bot.on('txt') handler bot.on('text', async (ctx) => { try { switch (ctx.message.text) {//my code} } catch (e) { console.error(e) } }) My handler for…
0
votes
0 answers

MongooseError: buffering timed out after 10000ms

Similar question has been asked many times. But i just cant figure it out. Solving this issue literally whole day. Basically, what i understood from the diffrent answers, the error means that im loading my model into the application before the…
0
votes
1 answer

Telegraf.js How to pass parameters to a function from inline keyboard

I have an array of messages containing some text and an inline keyboard with "delete" button. bot.command('items', ctx => { items.forEach(async data => { await ctx.reply(data.Title, …
JeyQORes
  • 5
  • 1
  • 4
0
votes
1 answer

Can I get suggestions of all possible properties of an object in TypeScript?

I'm trying to use Telegraf (4.6.0) types and I'm having an issue with exploring possible message properties. Here's what I do now: import { Telegraf, Context } from 'telegraf' const myBot = new Telegraf(myToken) listenerBot.on('message', (ctx:…
YakovL
  • 7,557
  • 12
  • 62
  • 102
0
votes
1 answer

how to know where user starting chat? from inside group or from inside bot directly?

I have created telegram bot using telegraf.js The bot is working correctly, however I need to handle a different thing if the user send message from inside bot directly, let's say the bot should replay with help commands documentations (for…
Eng. Samer T
  • 6,465
  • 6
  • 36
  • 43
0
votes
1 answer

How to send private message in Telegram Bot using Telegraf.js Node.js

I want to create a Telegram bot that can send message directly to users with their user_id saved in my db. Is there any way to do this?
0
votes
1 answer

How to unregister middleware in Telegraf?

When I add bot.hears(...), it registers middleware for handling matching text messages. But now it will handle those messages even if they are sent any time, even if not expected. So if I am creating a stateful service, I would like to listen to…
rightaway717
  • 2,631
  • 3
  • 29
  • 43
0
votes
1 answer

JS pass variable to event

Soo... I'm working on a Telegram Bot for Node.JS, after a user joined, my bot will welcome them: function Welcome(e) { console.log("Neuer Member"); console.log(e); //Das ist der, der joint let markup = Extra.markup( …
Ven
  • 114
  • 5
0
votes
1 answer

Telegraf.js: leave WizardScene with a button

I would put a button after a message in a WizardScene with a "Cancel" Button. But i retrieve some error: This is my wizard scene: const superWizard = new WizardScene('super-wizard', async ctx => { ctx.wizard.state.data = {}; …
Matt
  • 127
  • 1
  • 13
-1
votes
1 answer

How to restart the wizard scene in TelegrafJS?

I have a function which handles "/start" which enters into the wizard scene. Now, i have a message with the inline_keyboard with a btn called "redo". When i click on the "redo btn" i want is that it restarts the whole scene means it should start…
-1
votes
1 answer

Waiting for response from Telegraf.js user

Waiting for user response. For example, the bot asks the user for his age, he enters it and the bot must catch his answer and send the next question. How can i do this?
RIXIN
  • 3
  • 3
-1
votes
1 answer

How my bot can ask to users or bot need reply from users to send message intelegraf node.js bot?

bot.command("greeting", (ctx) => ctx.reply("Hello users, what's your name?"); ctx.reply("Hello Alex nice to meet you!")
Vieendya
  • 3
  • 3
-1
votes
3 answers

Telegraf JS: how can i clear history of a chat?

How can i Clear the Chat History, in my case the Bot Chat history with Telegraf.js? I saw in Telegram API that is there a way to clear History of a chat: https://core.telegram.org/method/messages.deleteHistory WIth messages.deleteHistory(), but i…
Matt
  • 127
  • 1
  • 13
1 2 3
4