i got banned two times now, i thought maybe my code have some problem.
my code:
from telethon import TelegramClient #importing telethon
#declearing api id and hash (you should put yours here. you can get them from my.telegram.org):
name = ""
phone = ""
api_id =
api_hash = ''
password = ""
bot_token = ''
channel_id = "PrivateVPNs"
client = TelegramClient(name,api_id,api_hash)
async def main():
await client.start()
await client.connect()
if not await client.is_user_authorized():
await client.send_code_request(phone)
await client.sign_in(phone, input("enter code:"))
chats = client.get_messages(channel_id, 15)
print(chats)
with client:
client.loop.run_until_complete(main())
couldn’t find a soloution…
New contributor
Mohammadnm is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.