telegram-cli
97 subscribers
3 links
Download Telegram
added partial channel support. Please check, that old methods did not break
what works with channels: 'channel_list', 'history <channel>' and 'post <channel>'. At least I hope, that it works
what doesn't work: receiving updates about channels (even about messages you sent to channels), and binlog mode of telegram-cli is probably broken
command 'msg <channel>' currently returns server error. I think that it is some feature that is turned off on server now, so I don't want to use msg command instead of post
although there are two different methods now: dialog_list and channel_list. Probably I will need to merge their to one list
in case you find error in old behavour, please write me to @vysheng
probably works mark_read
There is one more problem, that is interface problem. Message ids. In channels message ids are independent. So first message in every channel has id 1, second id2 and so on. Previous way with using message if for forward, photo load and so on does not work well in this case. It's rather easy to make some kind of long message ids for bots (for example "channel_id:local_id_in_channel", or just 64 bit long), but it's not very easy to use this way if you use this client as main telegram client (as I do). So I need some idea, how to fix it.
Current idea: each message will have permanent_id and temp_id. permanent_id is big (at least 64 bit, but I think it will be 128bit) number (or even string, I think it's better alternative). it is garanteed that you can access message by it's permanent id after telegram-cli restart, and probably (unless it is message to secret chat) after relogin. It's intended use for bots, since they are stubborn enougth to copy long msg id's. For other people there is alternative: temp id. These ids are given, when client receives new message and are started from 1. So they will remain valid only until restart of client, but will be much shorter and more easy to use.
Next iteration of test code commited to test branch on github. What works: I hope it doesn't crash. If it does, please send me backtrace. All methods should work. If not, please let me know. message ids are now temporary. To use permanent ids use --permanent-msg-ids. Also it may be useful to use --permanent-peer-ids. Probably you can send message to peer by permanent id even without [-W] key. What doesn't work: binlogs. Sometimes update duplicates, especially when you send message. Also json, lua and python don't work. It (at least json and lua) will be fixed in one of next commits. Please note, that msg_id from now on will be string, not number.
It's normal, that client writes lines like 'User deleted user#124001773'. It's just some strange stuff, that server sends inside answer on dialog_list and channel_list queries
Fixed json and some other bugs. Python and lua don't work yet. I want to rewrite lua part, so it may take some time.
There is a big commit (written by https://github.com/BenWiederhake) that allows to user libgcrypt instead of libopenssl. It you don't like linking openssl and GPL-licensed soft (like libreadline), you can now use libgcrypt. To use it run ./configure --disable-openssl. Also there are some small bug fixes.
Lua probably works now. At least it compiles
Added many operations with channels. I hope they work
telegram-cli is almost ready for master. Please report any bugs except python (it's disabled by default, it's not my code and I am not going to write it myself) and except binlogs (they don't work and I didn't yet decide, if they would be supported in new version). Also I'll try to check for memory leaks.
Fixed more bugs and fixed memory leak
Hi all. I don't have time this week, so I'll just push updates that I wrote last week. This include [html] prefix for commands like [html] post channel text or [html] msg peer text.

It adds slight supports some (pseudo-)html tags. Full list:
<b> for bold
<i> for italic
<code> for code
<br> for line break
some &-sequences (for now only with number 1--126)
Note, that only bots can send italic and bold (don't ask me why). So this message was posted from bot to allow bold and italic. Have fun!

Note, this there is small parser function in telegram-cli, so don't expect it to work in all cases (for example capital letters in tags don't work). You are free to write better one!
Well, Telegram just added new update with 'supergroups'. https://telegram.org/faq#q-there-39s-illegal-content-on-telegram-how-do-i-take-it-down . It should already work in test branch, but these supergroups will appear as channels (because they are channels). Dialog list now should show channels, so you don't need separate channel_list command. Telegram added terms of service, so I added method to show it (nothing interesting, though). Also created telegram-cli dev group (partially to test supergroups). There is join link: https://telegram.me/joinchat/AAZTvzwRgCYrDGW9MXBhfg . Also I plan to merge test to master tomorrow. Python doesn't work, so if anybody is interested in python, you are welcome to make it work.