Questions tagged [telethon]

Telethon is a Python 3 Telegram client library. It uses the normal Telegram API instead of the Bot API, which means it can perform all actions a regular user can perform. Use this tag when asking questions about using the Telethon library.

Python 3 Telegram client library which is used API of Telegram.

Home page: https://pypi.python.org/pypi/Telethon

1211 questions
-1
votes
1 answer

Cannot get message from telegram (telethon)

I want to make an auto reply message with telethon python. But when I run, it cannot get message and cannot reply my message. This is my code. Anyone can help me please def chatbot_response(msg): ints = predict_class(msg, model) res =…
corei54590
  • 9
  • 1
  • 4
-1
votes
1 answer

How can I scrape Telegram users from a Telegram Group?

So I've been trying for a long time, I found some pre-made programs, but they costs 100$. I've tried multiple apps and programs like Telegram Auto and Telegram Kit, but they cost a lot and I don't have such money right now. I am trying to do it in…
Daniel Halabi
  • 21
  • 1
  • 1
-1
votes
1 answer

How to forward every channels updates using Telethon

I would like to forward every updates from channels to my bot. Is it Possible with ForwardMessagesRequest ? I tried to use this Telethon example to build my personal code: https://github.com/LonamiWebs/Telethon/wiki/Forwarding-messages But i wasn't…
etnic90
  • 1
  • 1
  • 2
-2
votes
1 answer

telethon accounts get banned despite proxy

I have a simple code with which I work with accounts: from telethon.tl.functions.photos import DeletePhotosRequest from telethon.sync import TelegramClient def decor(func): async def wrapper(account, proxy, *args, **kwargs): proxy = { …
-2
votes
1 answer

How Creating or using a telegram bot that forward messages from something telegram group and forward this messages to my tg group?

this is my cod that i have? on python* import asyncio from telethon.sync import TelegramClient, events def main(): # Укажите свои api_id, api_hash и bot_token api_id = 27468555 api_hash = '0c05213e90441c28256c5ab8a0d3c266' bot_token…
-2
votes
1 answer

Python telethon. How can you prevent the FloodWaiTError error, or reduce its time

I was building a bot using the telethon library and ran into a problem with a FloodWaitError. I have created a function that subscribes to a list of telegram channels and while it is running I get this error very often. How can it be prevented? I…
Fiv_
  • 3
  • 2
-2
votes
1 answer

Telegram bot function with event handler not executing before program ends; how to fix and print results properly?

I made a function to test my telegram bot, it sends a request message to the chat bot to change some value in the database for this user. The problem is that all the code is played before the code of the function "first_handler" with the decorator …
BDBazuso
  • 5
  • 1
-2
votes
1 answer

How to make event.respond but just first sender will be responded? with Telethon

I have a question regarding the event on the telethon. So, I want to make something like event.respond(). But only the first sender will be responded by the bot. If there is a second sender - and the rest are not responded to by bots. How to make…
Ravi
  • 20
  • 1
-2
votes
2 answers

Telethon on Python: How download only photo?

stackoverflow. I beginer python developter and need help. I want download foto on my serwer from different telegram chenals. Have htis code, but it download all media including video. How i can chenge code to download only photo? I've read the…
-2
votes
1 answer

How do I can fix this problem of indented block?

This code does not work - I need help. I want to re-send a specific message. @events.register(events.NewMessage(chats='AAAAA')) async def me_handler(event): client = event.client if 'AAAAAAAA' in event.raw_text: async def main(event): await…
-2
votes
1 answer

To attract members of the channel specified in Telegram and send messages

how can I attract members of a group or channel in telegram using python and send them a specified message? I couldn't find any resources on this subject, can it be done with pyrogram or telethon?
apr yegn
  • 1
  • 1
-2
votes
2 answers

How to remove reply_keyboard in a message using telethon?

I want to remove/hide reply keyboard from a message I try: await event.edit(buttons=[]) but it doesn't work
yaschk
  • 320
  • 1
  • 11
-2
votes
1 answer

Telethon: I want to scrape all the links and just join the groups, not channels. but how to distinguish between them?

Here is my code and I need a way to get a True/False Boolean to find out whether if the received link is a group link or not. client = TelegramClient('session', api_id, api_hash) #check whether there's a 'joinchat' in the msg…
-2
votes
1 answer

How can I block an entity with user account?

I want to block an entity like user or bot with a user account. I cannot find any method for that. Also, it's good to exist some method for unblock entities.
MiakovA
  • 69
  • 8
-2
votes
1 answer

Python , telethon throwing flood error for adding more than 200 users into telegram channel

I have tried using InvitetochannelRequest method for adding the users to my telegram channel from csv file ,but not able to add more than 200 users to channel using telethon library. its throwing flood error can anybody help me on this
SKP
  • 151
  • 16
1 2 3
80
81