1,595 questions
1
vote
1
answer
122
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
148
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
563
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
190
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
88
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
58
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
365
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
72
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
154
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
261
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
186
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
123
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
84
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
63
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
82
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
29
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
938
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
160
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
48
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
237
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
133
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
96
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
249
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
63
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
554
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
34
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
363
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
0
answers
23
views
Error Code [There is no current event loop. loop = asyncio.get_event_loop()] in Telegram Bot Reminder Script
I'm new to coding with Python and I'm trying to create a Telegram reminder bot for my Duolingo practice. I used ChatGPT to help me with the code, but I can't seem to fix an error I'm encountering. I'm ...
0
votes
1
answer
175
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
34
views
Telegram ConversationHandler triggering inside another file
https://pastebin.com/6WVaqhuf - this is the auth.py
https://pastebin.com/1ct9pyrB - this is the sign.up
I was creating a conversation inside sign_up.py and wanted to trigger after user's choice from ...
0
votes
0
answers
45
views
How to add function to InlineKeyboardButton in Python-Telegram-Bot?
I work with python telegram bot version more than 20. I'm trying to make when I choose option 1 it would send a message with my function and when i choose for example option 2 it would return other ...
0
votes
0
answers
20
views
Script won't respond even with correct format
I'm trying to make a phone directory on Telegram as a bot with Python and here's what I have so far:
import pandas as pd
from telegram import Update
from telegram.ext import ApplicationBuilder, ...
0
votes
0
answers
93
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
0
answers
22
views
How do I count the maximum number of unique group members in a telegram?
I wrote a small bot to collect information about the maximum number of unique group members in a telegram. I used the python-telegram-bot library for the work. When a new member enters the group, we ...
0
votes
1
answer
92
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
0
answers
86
views
How to determine if a message on Telegram is a comment using pyrogram? (or any other library if not possible with pyrogram)
I need to differentiate between messages that are replies to a channel and comments under a channel post. I could not find any reliable way to do that and pyrogram does not give any info about whether ...
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
262
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
131
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
147
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
172
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 ...