[Feature Request] Pinned messages as room description
Currently there's not any easy way to locate pinned messages after they're posted, one solution could be to change the IRC room description to match whatever's pinned
How is pinned message implemented?
From what I can see, you can access that API from other libraries but it's not implemented in telegram-cli as development of that seems to have halted. I'll try and supply a list of what libraries have that API to hook in to.
I would also like to know what library can a good replacement of telegram-cli. telegram-cli leaks memory and has so many other issues that I have to restart it after running for one or two days.
I think that Telethon library (Python) hooks into these hidden APIs https://github.com/LonamiWebs/Telethon
https://lonamiwebs.github.io/Telethon/constructors/update_dialog_pinned.html
This library is awesome! I have updated https://github.com/MaskRay/telegramircd to substitue Telethon for telegram-cli to communicate with Telegram servers. The installation is different, please review the instructions in README.md.
I am tired of restarting telegram-cli one day or two... Hope telethon can be much stabler.
How to retrieve the pinned message of a chat/channel?
I'll test your latest version either tonight or tomorrow to see how it's going. The refactor looks very large, thanks so much for putting in the effort of rebasing this on a new library. I know that it's not an easy job, so many thanks for putting the time in to this :)
Testing the latest version, everything seems to be working as it did before.
As far as the exact API to get pinned messages I'm not sure of myself, but it might be this: https://lonamiwebs.github.io/Telethon/methods/messages/get_pinned_dialogs.html
In an IPython session in the directory containing telegramircd.session, I ran the following commands and found nothing related to pinned messages:
In [1]: from telethon import TelegramClient
In [2]: client = TelegramClient('telegramircd', ................)
In [3]: import telethon.tl as tl
In [4]: dialogs = client.invoke(tl.functions.messages.GetPinnedDialogsRequest())
In [5]: dialogs
Out[5]: <telethon.tl.types.messages.PeerDialogs at 0x7fa899881f28>
In [6]: dialogs.dialogs
Out[6]: []
In [7]: dialogs.chats
Out[7]: []
In [8]: dialogs.to_dict
Out[8]: <bound method PeerDialogs.to_dict of <telethon.tl.types.messages.PeerDialogs object at 0x7fa899881f28>>
In [9]: dialogs.to_dict()
Out[9]:
{'chats': [],
'dialogs': [],
'messages': [],
'state': {'date': datetime.datetime(2017, 11, 9, 6, 17, 45),
'pts': 264080,
'qts': 0,
'seq': 1199,
'unread_count': 421},
....
Any solution to fetch pinned message from a channel ? I also ran on same issue @MaskRay .
Might be under function 'GetPinnedDialogsRequest'