-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Py tg For New TG #109
Comments
It would be awsome! |
I agree :D |
It might be possible to use it already, sending the required json (TL schema) as string in Note: I haven't checked. |
I checked and it doesn't work. Telegram-cli consider it as improper command, triggers exception and exit. I tried to send json right into socket by using sendall(b(json)) - it returned, but then hang on receiving answer from server. Server didn't answer. Looks like server was waiting for something else... Can you help with that? I just need working raw command.. |
You could also connect with netcat to the CLI (assuming $ nc localhost 4458 and enter the commands there (obviously sending with enter |
It works through the netcat! {"ID":"SendMessage", "chat_id_":-191132333, "reply_to_message_id_":0, "disable_notification_":0, "from_background_":0, "input_message_content_":{"ID":"InputMessageText", "text_":"Test text here", "disable_web_preview_":0, "clear_draft_":0, "entities_":[]}} |
I'm puzzled. |
in telegram-cli failes this code
its /tdcli/interface.c:719: in_command_decref: Assertion `cmd->refcnt > 0' failed. I'll try once again from scratch to see if this is caused by some docker settings maybe. |
That's what pytg tells as I mentioned above - the problem is in assert from telegram-cli. :
debug of telegram-cli:
|
I thought, that
DEBUG:pytg.sender:Sending command edited is the real command that I send.
P.S. I have debug activeted in pytg and telegram-cli.
|
Ok. Now I solved the problem by using Unix sockets and removing
If i'm not using json, then |
if start telegram-cli from terminal with --json, we can see more specific error until stacktrace:
so, 'cmd->refcnt > 0' is a error in json parsing. with valid json on input we got another stacktrace:
telegram-cli awaits some json structure as input with --json option One of the right json we can see in example:
But full specs not provided, and this part only in closed-source piece of telegram-cli. I found available values for first level "ID": Click to expandAddChatMember In all, we can't use json mode today without full specs from author of telegram-cli. UPD: Founded description in TL-scheme |
What I was hoping to have is a TL parser, which would crate code automatically. |
I found one alternative for telegram-cli: Telethon |
It's very good but it hasn't on_msg_receive event for super groups! |
Hmm telethon looks good!
|
Anyone tried using telethon? Or what would you call current "industry standard" for python telegram implementations? |
I tried it out, looked pretty nice, but I couldn't get it to send a message on my own (without the interactive client made by them) |
any news? |
Hi.
please create new pytg for new tg >> https://valtman.name/telegram-cli
thanks
The text was updated successfully, but these errors were encountered: