Skip to main content

All Questions

0 votes
0 answers
29 views

Telethon event_handler throws error while clients is connecting

I’m facing an issue with the following code: import asyncio import random import traceback from telethon import TelegramClient, events from telethon.sessions import StringSession from config import ...
Олександр Третяк's user avatar
0 votes
1 answer
120 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 ...
himel21's user avatar
0 votes
1 answer
95 views

How to use context variables correctly in Telethon?

I'm developing a Telegram bot using the Telethon library. I want to pass the value of tags_cv from send_tag_list() to show_selected_tags(). But I get this error: `ERROR - Unhandled exception on ...
Kozorez-V's user avatar
1 vote
1 answer
86 views

python coroutine and while loop, how to run both

I'm trying to run two coroutines together and using async, one is teleton telegram client and one async task who get data every minute for the telegram bot. Some code: from asyncio import Runner from ...
Zero Ainz's user avatar
0 votes
1 answer
461 views

telethon.errors.rpcerrorlist.FileReferenceExpiredError: The file reference has expired and is no longer valid

vesions: python: 3.10.12 telethon: 1.34.0 The below downloads media files from telegram. import asyncio import tempfile from telethon import TelegramClient from telethon.tl.types import ...
nlblack323's user avatar
1 vote
0 answers
55 views

Using Telethon and Quart with asyncio yields loop issue "got Future <Future pending> attached to a different loop"

My telethon bot was working until I added Quart to my project and to main.py import asyncio from datetime import datetime from bot.telegram_bot import TelegramBot, client from web.server import ...
Qliver's user avatar
  • 61
1 vote
0 answers
92 views

Problem with asyncio in python script, cannot fetch telegram bot response

I wrote a python script which interacts with telegram bot. it's working fine on my machine, but working weird on other computer import platform import asyncio import re from telethon import ...
youjustmy's user avatar
1 vote
1 answer
152 views

Seeking advice on optimizing synchronous loop performance with asyncio and telethon in Python

When running my code I realized that after around 30 requests it gets very slow to fetch the rest, taking a long time to complete the code. My goal with this code is to fetch users from a Telegram's ...
Rafael Sanches's user avatar
0 votes
0 answers
35 views

Can't authorize in normal mode

I have this piece of authorization code which only works in debug mode( it also shows this : Warning: Password input may be echoed. But i don't know how to handle it). with TelegramClient(...
user11225404's user avatar
0 votes
1 answer
315 views

limit of getting entities in telegram api

I want to parse all tg channel commentators, there is my code: async def getCommentators(self, channelName): print('started') async with self.client as client: async ...
mushi's user avatar
  • 13
1 vote
1 answer
120 views

Python script using `asyncio` library won't stop running

I am using the libraries telethon and asyncio to scrape messages on Telegram but somehow my Python script below won't stop running. It got to the stage where it's printing out all the filtered ...
Leockl's user avatar
  • 2,150
2 votes
0 answers
443 views

How to download all the messages in a Telegram group?

I am trying to use the below code in a Jupyter NoteBook to download all the messages of a specific Telegram group: import csv import asyncio from telethon import TelegramClient from telethon.sessions ...
Foad S. Farimani's user avatar
0 votes
1 answer
664 views

Telethon event handler not firing when used in an asyncio task with another task

I'm trying to get two tasks with infinite loops running simultaneously. One of them involves running the Telethon client indefinitely, the other involves a while loop in order to check for connections ...
jm123456's user avatar
  • 635
0 votes
1 answer
581 views

continuing outer loop of asyncio python

I want to continue my outer loop but in async function it looks like, when the task completed program will stop. this is piece of my code I want to do something in main every 50 seconds and then call ...
Mohamad Sh's user avatar
0 votes
1 answer
374 views

How to call a discord bot`s function from another script. Python

I am trying to make a python script, that takes messages from a telegram channel and send them to the discord server`s channel. I am stuck with discord. Absolutely cant have an idea how to make it ...
user avatar

15 30 50 per page
1
2 3 4 5