I used MemorySession()
Now it's working
from telethon import TelegramClientЧитать полностью…
tbot = TelegramClient(MemorySession(), API_ID, API_HASH)
tbot.start()
It is occuring because Multiple applications are accessing the database at the same time
Читать полностью…Nope , it's mentioned in docs too.
Only user bots can call get_messages and iter_messages functions
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.
Читать полностью…New StackOverflow question
How to get the original first name and last name of the user in Telegram through Telethon?
https://stackoverflow.com/q/79284028
You can edit using msg id if you have that otherwise need to read history that's required a userbot
Читать полностью…async def handler(event):
text = event.raw_text
if text == "/clear":
messages = client.iter_messages(-1002272402219, limit=48)
async for mes in messages:
try:
new_text = mes.text+"\n@ididid"
await client.edit_message(-1002272402219, mes.id, new_text)
print(f"ok {mes.id}")
except Exception as e:
print(str(e))
with memorysession you'll need to login every time unless you're dilligent about saving it before the program exits.
sqlitesession should not have any issues unless you really are doing something strange (session reuse, threads, bad fs permissions, etc)
Hi and welcome to the group. Before asking any questions, please read the rules from the group's description, and don't forget to read the docs. Make sure you are using the latest version with pip3 install -U telethon
, since most problems have already been fixed in newer versions.
i am using this in my login
client: TelegramClient = TelegramClient(Читать полностью…
json_data["sess"],
json_data["app_id"],
json_data["app_hash"],
system_version=json_data.get("sdk"),
app_version=json_data.get("app_version"),
device_model=json_data.get("device"),
system_lang_code=json_data.get("system_lang_pack")
or json_data.get("lang_code")
or "en",
lang_code=json_data.get("lang_code") or "en",
lang_pack=json_data.get("lang_pack") or lang_pack,
proxy=proxy_details,
flood_sleep_threshold=floodwait,
timeout=15,
base_logger=log.logger,
)
why my new accounts are getting banned from few days? i almost lost 100 of accounts
Читать полностью…I have a channel with 80k posts
I need edit all posts captions with userbot or just bot
mtproto proxy method is outdated
update when?
https://docs.telethon.dev/en/stable/basic/signing-in.html
Thanks, waiting for something like this. Using telethon how can I use it with bot. Currently I only use app and I have like 4 new accounts the maximum message I can send is 3, I don't know why that is, is there any thing I am missing
Читать полностью…Hey. How can I forward message from one chat to another without mentioning sender?
Читать полностью…i use iter_messages but i got
telethon.errors.rpcerrorlist.BotMethodInvalidError: The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot (caused by GetHistoryRequest)Читать полностью…
can you remove floodwaits by changing session? i got a one week long one
edit: tested it, you cant