Questions tagged [telegram-bot]

The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram which is an instant-messaging app with documented API. Use this tag if you're writing a telegram bot and have a specific question regarding the Bot API.

Available methods

  • getMe
  • sendMessage
  • forwardMessage
  • sendPhoto
  • sendAudio
  • sendDocument
  • sendSticker
  • sendVideo
  • sendVideoNote
  • sendVoice
  • sendLocation
  • sendVenue
  • sendContact
  • sendChatAction
  • getUserProfilePhotos
  • getUpdates
  • setWebhook
  • removeWebhook
  • getFile

Links:

4905 questions
1
vote
2 answers

How to send a message in a synchronous function by a bot in python aiogram?

I have a synchronous function and in it I need to implement sending messages using a bot in python aiogram. I found that you can send a message not using bot.send_message (...), but requests.get (...). But this way you cannot specify parse_mode and…
429
  • 63
  • 8
1
vote
1 answer

UniversalTelegramBot doesn't work with ESP32 but it doesn't show an error. I think it's a libraries version compatibility issue,could someone help me?

I'm developing a program in Arduino Ide (v. 1.8.13) which takes brightness values and send them to ESP32 Web Server. Also, I want to add the posibility of seeing the data via Telegram. At the moment I just want to send '/start' to the Telegram bot…
Lau
  • 11
  • 2
1
vote
1 answer

Why does Telegram give me an empty POST request on the webhook?

I followed these steps: Registered a bot with BotFather. Send a post request for the webhook (https://api.telegram.org/bot[BOTID]/setWebhook) with the URL being https://example.com/myscript.php Double check with getWebhookInfo and it showed it is…
Mark
  • 16,906
  • 20
  • 84
  • 117
1
vote
2 answers

add a callback to telegram-bot inline_keyboard to count button clicks

I am making a telegram-bot in NodeJS. This is a code snippet I am having an issue with: let counter = 0 bot.onText(/\flexbox (.+)/i, async (msg, match) => { console.log(msg) console.log(match) const chatId = msg.chat.id; …
1
vote
1 answer

How to delete a message when clicking on another button in Telebot?

When I click on the inline button, it will give me a text. And with each next press, he again sends the text. I want to make it so that when you click on a new button, the old message is deleted and a new one appears. I hope I explained clearly…
FollEnsoo
  • 39
  • 1
  • 6
1
vote
2 answers

I built a webscraper via python and I want to integrate it to a telegram bot but i keep getting a default page

So i made a script that just scrapes for all hyperlinks on linkedin. i dont want anything else. this is what i did. import re import requests import logging from telegram.ext import * from bs4 import BeautifulSoup from datetime import…
nosirrah
  • 31
  • 6
1
vote
1 answer

How to forward messages of selected people from telegram group A to telegram group B using telethon

So I'm able to send all the chats of specified group to another group with the help of telethon's telegramclient and events below is my code. from telethon import TelegramClient, events api_id = YOUR_ID api_hash = YOUR_HASH client =…
1
vote
1 answer

How to create a Telegram Bot Inline Keyboard Menu that doesn't affect everyone?

I have created a Python Telegram Bot with an Inline Keyboard multi-level menu. The idea behind the implementation is so that people can switch between different categories within a restaurant menu (eg. Pasta and Mains) to see the items that are…
XDPlatypus
  • 23
  • 5
1
vote
1 answer

How do I make the bot not leave a telegram group?

I created a new Telegram group, and my problem is that I cannot add any bot to it, knowing that I have created a channel and have linked it to the group and the bot is added to the channel with no problems. Please help me in adding the bot bot exit…
Matarwy
  • 11
  • 1
  • 4
1
vote
1 answer

Telegram bot privacy mode and groups

Is it possible to programmatically enable/disable privacy mode and groups mode for the bot? Can bot do it by itself?? Or only BotFather can do that? Also, is the 20 bots restriction per account still a thing?
Mugetsu
  • 1,739
  • 2
  • 20
  • 41
1
vote
1 answer

JobQueue.run_repeating to run a function without command handler in Telegram

I need to start sending notifications to a TG group, before that I want to run a function continuosly which would query an API and store data in DB. While this function is running I would want to be able to send notifications if they are available…
1
vote
1 answer

sending message to telegram bot

i need some help, am trying to send message to telegram bot but things are not working out for me, am just trying to archive what i want to do. am new to jquery and javascript below is what i tried …
Jeff Docm
  • 15
  • 2
  • 4
1
vote
1 answer

Telegram Bot Payment doesn't work with Apple Pay

I made a bot which accepts payment via the telegram payment api. I connected the bot with stripe and it works fine with credit cards, but I get an 'Apple Pay Is Not Available in "Telegram"' error message if I try to pay with Apple Pay. Is there any…
Lukas Resch
  • 148
  • 15
1
vote
1 answer

Send a scheduled message in my telegram bot linked to a google spreadsheet

I've built a telegram bot using guidance from this video: https://www.youtube.com/watch?v=mKSXd_od4Lg&t=348s Is there any way to edit the sendText function such that I could allow the bot to send a message at a set time? function…
Colin
  • 31
  • 1
1
vote
1 answer

Make telebot mute new user for 24 hours

I have this code import time from time import time bot = telebot.TeleBot('') @bot.message_handler(content_types=[ "new_chat_members" ]) def mut(message): bot.restrict_chat_member(message.chat.id, USER_ID ,…