1,589 questions
1
vote
1
answer
125
views
InlineKeyboardButton with callback_data doesn't work
InlineKeyboardButton with callback_data doesn't work. When I click on it, nothing happens.
Here is how I create the button:
from django.apps import apps
from asgiref.sync import sync_to_async
from ...
2
votes
1
answer
152
views
Get telegram's chat's history
I want to get some previoius messages from chat with Python telegram bot's library.
Here is my bot's handler:
class BotController:
def __init__(self) -> None:
self.token = os.getenv(&...
0
votes
0
answers
580
views
How to Retrieve the Telegram Store Gift Catalog via Bot API for a Business Account?
[Description:
Hello, Stack Overflow community! I am developing a Telegram bot using Python with the python-telegram-bot librarythat interacts with a business account to send gifts to users. The ...
1
vote
1
answer
63
views
Is accessing details of message replied from another chat possible
I am using the python-telegram-bot package to develop a Telegram bot.
I was wondering if it's possible to access the details of a message that has been replied to from another chat?
Broader ...
1
vote
1
answer
202
views
Userbot Telegram API
I am creating a userbot. I can't figure out how to implement it: when I am offline from Telegram (I exit the app), it automatically changes the name in one way and when I am online in another. I can't ...
0
votes
0
answers
89
views
How to monitor new users joining a Telegram channel using Telegram API?
I'm trying to track new users joining a Telegram channel (not a group) using the python-telegram-bot library (v20.x). My bot is an admin in the channel, but it doesn't detect new_chat_members events.
...
0
votes
0
answers
61
views
How to create a Telegram user mention link that works across all devices and profile types in a bot message?
I'm developing a Telegram bot, and I want to generate clickable user mentions in admin reports. These mentions should:
Link to the user's profile
Work on all platforms
Handle any kind of Telegram ...
1
vote
0
answers
377
views
Problem with receiving business connection id in aiogram bot
There was a problem, I am making a business bot on aiogram, but I can not understand how to implement a connection check, I saw the following system in one bot, the bot asks to add itself as a chat ...
-5
votes
1
answer
98
views
What Danger am I Inviting if I Store Telegram User IDs Unhashed/Unencrypted in a Database? [closed]
I am working on a bot that echoes the latest YT video title of a specific Youtube Channel to its users. However, it will only echo the video title only if it contains at least one of the user's ...
0
votes
0
answers
68
views
Python telegram-bot endless background task
With python-telegram-bot v0.22 some things have been changed and I can't get the code to work. I've tried a a lot of things but keep running into a problem. Here is my simplified code. I want to write ...
0
votes
0
answers
76
views
Problem in deploying telegram bot in Render. There is no error but the bot does not respond to /latestjobs
import os
from flask import Flask
from threading import Thread
from telegram import Update
from telegram.ext import (
ApplicationBuilder,
CommandHandler,
ContextTypes,
)
import ...
1
vote
1
answer
157
views
Pyhon Telegram Bot Multiple Bots
I have multiple bots that utilize Python Telegram Bot module. Each bot has code like:
from telegram.ext import Updater, CommandHandler
def start(update, context):
update.message.reply_text("...
0
votes
1
answer
271
views
How to Send Files Larger than 2GB Using Telethon in Telegram [closed]
I'm using Telethon to send files on Telegram, but I've run into a problem with the 2GB file size limit. Telethon only allows sending files up to 2GB, while Telegram itself supports sending files up to ...
0
votes
1
answer
191
views
How to solo-test a telegram bot within a group as multiple users
I made a Telegram bot with python-telegram-bot library, and I want to test it in a group where it has to interact with many users at the same time. Because I cannot test it only by myself (I have only ...
0
votes
0
answers
124
views
Adding personal channel in profile's bio
Is it possible to add personal public channel in Telegram profile bio using Telethon? If it is, then how I can do it?
It can be done manually on the device (phone or desktop) but my goal is to ...
0
votes
0
answers
86
views
The function of replying to telegram bot messages does not work. How it fix?
The main task during development is a technical support bot. The user writes a problem to the telegram bot, which forwards it to a supergroup topic. Inside the topic, support discusses the problem and ...
1
vote
0
answers
69
views
Configuring aiogram 3.16 bot to use the server's proxy
This aiogram bot I made runs perfectly on my PC, but when I went to run it on their server, it gives me this error
aiogram.exceptions.TelegramNetworkError: HTTP Client says - ClientConnectorDNSError: ...
1
vote
0
answers
89
views
How to suppress "Traceback" when it loses connection with Telegram bot
I'm developing and building a Python script for Telegram bot. I was adding the following codes in a script to report any error via output from Linux terminal:
logging.basicConfig(
format='%(...
0
votes
0
answers
33
views
ConversationHandler issue with telegram python
Not being able to call /order twice. I call /order, without doing anything, i call /order again. It's not calling the async def order. It should work without allow_reentry=True. WHY?
ORDER_CATEGORY, ...
0
votes
1
answer
110
views
I continue to get errors regarding ParseMode when trying to start my telegram bot
This is the error I get every time I try to start the bot.
(venv) C:\Users\Due Bighelloni\Desktop\bingo bot>python versolarmoniabingobot.py Traceback (most recent call last):
File "C:\Users\...
0
votes
1
answer
954
views
Telegram Mini App: can't transfer data from mini app to bot
I am writing a bot for Telegram using the python-telegram-bot library. I am connecting mini app to it. The application starts and can even receive data from the bot, but for some reason the data does ...
1
vote
1
answer
163
views
Is there a method to accept pending requests for membership in a channel or group?
For Python telegram bot is there a method to accept pending requests for membership in a channel or group?
def get_pending_requests(update: Update, context: CallbackContext):
try:
...
0
votes
0
answers
49
views
PyQt5 Application with PythonTelegramBot (PTB) coroutine
I'm struggling with running python-telegram-bot-21.10 as a coroutine to a PyQt5 application using Python-3.12.7 (intended to run on a Raspberry Pi).
I had this setting operating for some years now ...
1
vote
2
answers
2k
views
'Only timezones from the pytz library are supported' even after not using
I got the error TypeError: Only timezones from the pytz library are supported even after not using it with python-telegram-bot
File "/home/shubham4538/mysite/index.py", line 38, in main
...
1
vote
1
answer
247
views
Banning telegram channels from groups as a bot
I have a bot that needs to warn and ban users in a group. But I cannot ban them if someone writes as a channel. I want to ban the channel, not the owner
message.from_user returns a fallback value, ...
1
vote
1
answer
138
views
Why is my bot not able to detect when a user leaves in Telegram?
General Information: I am using Python 3.11.0 and python-telegram-bot==21.5.
I am having some issues with my Telegram bot. The general idea of the bot is to keep track of a timer that is set for each ...
0
votes
1
answer
97
views
python telegram bot job queue on start-up
I am using async version of python-telegram-bot lib 20+
persistence = PicklePersistence(filepath="pickle_persistence")
application = Application.builder().token(token).persistence(...
0
votes
0
answers
252
views
How to end a currently active Telegram bot conversation and start a new one using specific keywords in Python
I’m building a Telegram bot using python-telegram-bot, and I’m using a ConversationHandler to manage conversations. Here's my handler setup:
python
conv_handler = ConversationHandler( entry_points=[...
0
votes
0
answers
68
views
"How to use messages.Report with Pyrogram RAW API? Getting 'can't
from pyrogram.raw.functions.messages import Report
from pyrogram.raw.functions.channels import GetChannels
from pyrogram.raw.types import InputPeerChannel, InputReportReasonSpam
from pyrogram.raw ...
0
votes
1
answer
574
views
How to run a Telegram bot polling asynchronously without blocking the main application (using python-telegram-bot version >= 20)?
I am trying to run a Telegram bot using the python-telegram-bot library (version >= 20) in asynchronous mode. The problem is that when I start the polling, the whole application blocks. I have ...
0
votes
0
answers
20
views
How can I hide ReplyMarkup and show InlineKeyboardMarkup without sending a new message?
I am trying this for now, using python-telegram-bot==20.6:
async def callback(update: Update, context: ContextTypes.DEFAULT_TYPE):
buttons = [
[InlineKeyboardButton(text="CONFIG",...
0
votes
1
answer
35
views
python anywhere flask import module error
I'm trying to setup a server in python anywhere but I'm facing module import errors
File "/home/Adejuwonlo/Twitter_Automation/./services/telegram_service.py", line 2, in <module
>
...
0
votes
2
answers
370
views
how to count the number of reactions of a post in a channel. pyTelegramBotAPI?
I'm trying to create a chatbot that will read the number of reactions and send them to me. In the pyTelegramBotAPI documentation, I found the message_reaction_count_handler and ...
0
votes
0
answers
24
views
telegram bot to trigger share_to window with checkbox
I am using python-telegram-bot module to create a InlineKeyboardButton called invite. I would like the user to click the invite button then a share_to window with checkbox showing up like this .
But ...
0
votes
1
answer
178
views
Real Time Telegram Message Storer
Well, so basically what I am trying to do is capture and store the messages posted on a SPECIFIC Telegram Group/Channel, live, in real-time. I have gone through the documentations, tried writing the ...
0
votes
0
answers
94
views
Is there any way to download files from TG-channel with using telebot python module?
I tried to make a bot that downloads files from Telegram channel, but except of good code I don't get files that may be downloaded in my directory. I tried this code:
@bot.message_handler(...
0
votes
1
answer
94
views
Multiple download file from telegram using python-telegram-bot
I wrote this function to download big files from Telegram using aiogram bot.
I call the function with message handler with filter:
application.add_handler(MessageHandler(filters.VIDEO, ...
0
votes
1
answer
294
views
Telegram bot - kicking users using python-telegram-bot library
I want to create a bot that kicks users from group based on certain condition (doesn't matter).
My problem is - I found function that kicks users ( Bot.ban_chat_member() from python-telegram-bot ), ...
0
votes
2
answers
267
views
how to find users who forwarded messages to a group using aiogram 3
how to find users who forwarded messages to a group using aiogram 3. that is, if someone forwards messages in the group, the bot should alert the admin. is it possible to do so? I can't identify the ...
0
votes
1
answer
138
views
ERROR: Event loop is closed in ThreadPoolExecutor
In a .py module I created this function
from utils.telegram_utils import telegram_message
...
counter = count(1)
def open_websites_with_progress(url):
risultato = ...
0
votes
0
answers
115
views
Issues with PDF extraction using pdfminer in a Telegram bot with Langchain
I'm developing a Telegram bot that allows users to send PDF files. The bot should extract text from the PDFs using pdfminer and respond to user queries. However, I'm facing dependency issues, ...
0
votes
1
answer
150
views
How to make specific text bold in the output of my Telegram bot?
I'm working on a Telegram bot and I want to make certain parts of the text bold in the response when providing the profile context of a site. Here’s a snippet of my code that retrieves and formats the ...
0
votes
1
answer
173
views
python telegram bot async not working simultaneously in 2 groups
I have a telegram bot written with python telegram bot package with the latest release and i have a problem,
the bot runs fine everything works but when i try to run it in 2** different groups** at ...
0
votes
1
answer
1k
views
RuntimeError: Event Loop Already Running in Telegram Bot with asyncio and python-telegram-bot
I'm developing a Telegram bot that suggests movies using the python-telegram-bot library and IMDbPY. I switched from synchronous to asynchronous code using asyncio to handle waiting times more ...
0
votes
2
answers
8k
views
How To Get Actual URL Of A Telegram Mini App
It's known knowledge that telegram mini apps are just simple sites being accessed via bots. So my question is, how do i get the actual url to the site displayed when a mini app is opened? The answer ...
0
votes
1
answer
296
views
Telegram Bot ConversationHandler Skips Waiting for User Input and Gives AttributeError 'NoneType' object has no attribute 'reply_text'
I'm building a Telegram bot that interacts with users to edit and upload videos using the python-telegram-bot library. The bot retrieves videos from Reddit, edits them using moviepy, and then asks the ...
0
votes
1
answer
84
views
Looping error from telegram to discord in python
I pulled this code from a github repo https://github.com/Sqble/Telegram-To-Discord-Bot-Fixed/blob/master/forwardgram.py and am running into a couple errors on the loop.
from telethon import ...
3
votes
1
answer
145
views
Unable to Download Multiple Images from Telegram Media Group Using Async Function
This question is a follow up from this question asked earlier here
I need help in trying to modify this code section which I am currently using to download just 1 image.
async def handle_s_command(...
0
votes
1
answer
41
views
Immediately create another conversation after one conversation end with python-telegram-bot
I'm trying to implement a telegram bot with the following flow:
User A sends a request to Bot by command
Bot saves the request to database, replies A that Bot has received the request and the request ...
0
votes
0
answers
107
views
does not see the aoigram library in VS Cod, what should I do?
I wrote the telegram bot code. When running the main file, it throws an error:
from aiogram import Bot, Dispatcher
ModuleNotFoundError: No module named 'aiogram'
I use VS Code, installed aiogram and ...