I have not engaged in spam behavior
I just wanted to import contacts or import user information by phone number
there is a new format
t . me / + 1 2 3 4 5
You can try that, no rate limit. But the downside is that it only gives good results if the user has the "who can find me by number" set to "everyone"
Telethon is free software. That means using it is a right: you are free to use it for absolutely any purpose whatsoever. However, help and support with using it is a privilege. If you misbehave or want to do bad things, despite possibly having good intentions, nobody is obligated to help you.
Читать полностью…Does anyone know a quick way to import contact or get user information from thousands of phone numbers?
ImportContactRequest or ResolvePhone gives me contact limitations
Does anyone know of another way?
e e
I wrote the following function to transform my text but I only get literal < etc..
def html_fix(text):Читать полностью…
text = text.replace('<', '<')
text = text.replace('>', '>')
text = text.replace('&', '&')
return text
async def main():
await client.start()
original_text = "<example> & <test>"
fixed_text = html_fix(original_text)
message = f"<pre>\n{fixed_text}\n</pre>"
await client.send_message('username_or_chat_id', message, parse_mode='html')
from telethon import TelegramClient, eventsЧитать полностью…
api_id = 'YOUR_API_ID'
api_hash = 'YOUR_API_HASH'
client = TelegramClient('session_name', api_id, api_hash)
async def main():
await client.start()
message = """<pre>
<example>
<div>Это пример HTML-кода</div>
</pre>"""
await client.send_message('username_or_chat_id', message, parse_mode='html')
with client:
client.loop.run_until_complete(main())
That is not related to Telethon. Please move to a different group with the correct topic to continue that conversation
Читать полностью…client = TelegramClient('userbot', API_ID, API_HASH)Читать полностью…
async def main():
try:
logger.info("Connecting to Telegram...")
await client.connect()
if not await client.is_user_authorized():
logger.info("User not authorized. Sending code request...")
await client.send_code_request(PHONE_NUMBER)
code = input("Enter the code sent to your Telegram: ").strip()
await client.sign_in(PHONE_NUMBER, code)
logger.info("Signed in successfully!")
logger.info("Telegram client is running. Press Ctrl+C to stop.")
await client.run_until_disconnected()
except Exception as e:
logger.error(f"An error occurred: {e}")
await client.disconnect()
if name == 'main':
asyncio.run(main())
from telethon import TelegramClientЧитать полностью…
from html import escape as FIX
api_id = 'YOUR_API_ID'
api_hash = 'YOUR_API_HASH'
client = TelegramClient('session_name', api_id, api_hash)
async def main():
await client.start()
original_text = "<example> & <test>"
fixed_text = FIX(original_text)
message = f"<pre>\n{fixed_text}\n</pre>"
buying premium subscription would help. with other ways you'll encounter flood wait error sooner or later, but this might help:
https://gist.github.com/painor/7e74de80ae0c819d3e9abcf9989a8dd6