1,581 questions
Tooling
0
votes
2
replies
47
views
Request of all generated invite links in chat
Is there some functional in Telethon to get all invite links for chat, like GetExportedChatInvites in pyrogram? Or how can I invoke this function of core API?
0
votes
0
answers
101
views
How to get forwarded user id? (python telegram bot)
async def theirs(update: Update, context: ContextTypes.DEFAULT_TYPE):
if update.message.text == "Others User ID":
await update.message.reply_text("OK. Send me a forwarded ...
1
vote
1
answer
150
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
231
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
748
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
73
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
303
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
111
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
87
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
529
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
121
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
86
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
1
answer
262
views
Python 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
372
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
254
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 ...
1
vote
1
answer
252
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
105
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
1
answer
125
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
1k
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
207
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:
...
2
votes
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
333
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
181
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
121
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
1
answer
770
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
1
answer
38
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
445
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
1
answer
200
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
109
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
118
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
350
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
310
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
155
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
124
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
167
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
190
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 ...
1
vote
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
9k
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
337
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
87
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
154
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
42
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
126
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 ...
1
vote
0
answers
77
views
How to get stats of telegram message in channel or group using api
How to get stats / views of telegram message in channel or group using api ?
1
vote
1
answer
765
views
Telegram Bot: How to Download Multiple Photos from the Same media_group_id in a Single Update?
This question is a followup from the following question asked in a previous post.
This is my code block to download all photos from a telegram bot within the same media_group_id context.
async def ...
2
votes
1
answer
781
views
Getting multiple images to download from telegram bot
I have this code
file_name = f'photo_{update.message.message_id}_{photo.file_unique_id}.jpg'
full_download_url = f"https://api.telegram.org/file/bot{BOT_TOKEN}/{download_url}"
logger.info(f'...
0
votes
1
answer
28
views
Sending media python-telegram-bot (ASYNC)
How could I send media (photos) to the bot users?
0
votes
1
answer
471
views
You need to accept the user’s message in aiogram after the bot’s message has been sent
My bot sends a message like “enter the quantity to exchange:” and I need to accept the message that the user sent after this message.
I tried through "message.text" but I was getting the ...
0
votes
1
answer
171
views
pythonanywhere server shutdown automatically
What should I do to keep my bot running all the time?
I've created a telegram bot and host it on "python anywhere" (free plan). When I run it in the morning everything is ok, but when I want ...
0
votes
1
answer
86
views
Is there any way to create a telegram bot with Telebot library that can drop reactions into messages users send?
Is there any way to create a Telegram Bot with Telebot library that can drop reactions into messages users send?
For example the following image:
I have tried many times but it seems impossible.
I ...