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

How can I quickly download and send audio from youtube?

How can I quickly download audio from YouTube by URL or ID and send it to Telegram bot? I've been using youtube-dl to download audio, save it on hosting and after that send it to user. It takes 1-2 minutes to do that. But other bots (like this one…
hellcaster
  • 79
  • 1
  • 7
1
vote
1 answer

How to get phone number if user already shared with AIOgram

# keyboard share_keyboard = types.ReplyKeyboardMarkup(resize_keyboard=True, one_time_keyboard=True) share_button = types.KeyboardButton(text="Share",…
Frank Delan
  • 13
  • 1
  • 5
1
vote
1 answer

An error has occurred: sys:1: RuntimeWarning: coroutine 'UserMethods.get_entity' was never awaited

An error occurs sys:1: RuntimeWarning: coroutine 'UserMethods.get_entity' was never awaited Now I'm doing a bot for Telegram. To work with the Core API, I use the Telethon library for Python 3. Line of code: username = 'channel' # channel…
tera97
  • 13
  • 2
1
vote
1 answer

SetChatPermissions using pyTelegramBotAPI

I am trying to create a bot that will set chat permissions using pyTelegramBotAPI package but it returns an error when parameters are passed. Could anyone help me with my code? import os import telebot API_KEY = os.environ['API_KEY'] bot =…
Computist
  • 11
  • 1
1
vote
1 answer

How to get info from reply on specific message - Telegram Bot

Let's say I have this command handler: @bot.message_handler(commands=['setalarm']) def setalarmcmd(message): alarmMessage = "Let's start with setting up alarm.\n\n" \ "First of all, provide the pair you want to observe." …
dokichan
  • 857
  • 2
  • 11
  • 44
1
vote
1 answer

php telegram sendPhoto not working (url & file location)

I need some help if possible with php sendPhoto api, I've been using the sendPhoto method in php on my apache server to auto send images into telegram, I've been using this same method for almost 6-7 months and from few days ago suddenly the api…
1
vote
1 answer

How to send large video on a channel using a telegram bot?

Here's my code: from telegram import Bot bot = Bot( token="XXX" ) def send_video(chat_id, video_path): print(f"Sending '{video_path}' to {chat_id}...") bot.send_video( chat_id=chat_id, video=open(video_path, 'rb'), …
WaWalex
  • 19
  • 5
1
vote
1 answer

How to hide telegram.vendor.ptb error and warning messages?

I am running a telegram bot with the code below. def main(): """Start the bot.""" global token, allowedUsers # Create the Updater and pass it your bot's token. updater = Updater(token) # Get the dispatcher to register handlers dispatcher…
Aaron Jones
  • 72
  • 2
  • 9
1
vote
1 answer

How do i save the authentication with puppeteer?

I need to talk to a telegram bot, with my web app. So i decided to do a web scrapping, i do not know if its the best strategy. When i try to access the telegram web, i need to authenticate and then proceed to the chat, but if i run the server again,…
1
vote
1 answer

How to send a photo with .webp extension via telegram bot

When I try to send such a photo, I get an error: example: bot.send_photo(message.chat.id, photo=test.webp) but i use links (hope it doesn't affect) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad…
Deprool
  • 75
  • 8
1
vote
1 answer

Telegram-bot replies to messages from specific user in group chat (aiogram)

I want my bot to reply to a certain person in chat every time he writes (in fact every 2 hrs, like regular cuddling) e.g. User1: Good morning everyone User2: Good morning Bot: (reply to User2): Have a nice day! Now i can send messages to group…
Jenny
  • 11
  • 4
1
vote
2 answers

Telegram bot keyboard resize_keyboard in php

I am working on a telegram bot using php, I want to resize my ReplyKeyboardMarkup button to fit each of the keyboards. I want the first button to take the full width of the keyboard and the second and fourth button takes the middle then I want the…
Emem Edem
  • 21
  • 1
  • 5
1
vote
1 answer

Telegram has empty message if channel is Restrict Saving Content in telethon

I have a simple python script to read a message from Telegram-Channle. when the Channel with option Restrict Saving Content is enabled, then the message is empty. I use Telethon==1.23.0 from telethon import TelegramClient, events api_id =…
Emadoo
  • 57
  • 1
  • 8
1
vote
0 answers

Is there a way to view a list of all Telegram groups or channels which didn't belong to any folder?

I want to view a list of all Telegram groups or channels which didn't belong to or weren't included in any folder that I've created before. Can anyone help me? Thanks in advance!
Baebs
  • 21
  • 4
1
vote
1 answer

python telegram bot ignoring messages

From time to time my telegram bot seems to ignore messages. Unfortunately it never happens to me but to other users and only when they are asked to upload a photo or pdf. Sometimes the corresponding handler is not called. The problem persists even…
Christian K.
  • 2,785
  • 18
  • 40