vysheng / tg

telegram-cli
GNU General Public License v2.0
6.45k stars 1.52k forks source link

Make telegram-cli available as a weechat plugin #1097

Open raedah opened 8 years ago

raedah commented 8 years ago

Make telegram-cli available as a weechat plugin.

https://weechat.org/files/doc/devel/weechat_plugin_api.en.html

https://github.com/weechat/weechat

ibabushkin commented 8 years ago

It would actually make more sense to write a weechat plugin that relays input to telegram-cli, which can be run in deamon mode. That's also the way some frontends handle it. I might do this soon(ish).

hiliev commented 8 years ago

@ibabushkin my thoughts exactly. It also follows the Unix philosophy of combining tools and not reimplementing existing functionality.

ibabushkin commented 8 years ago

Yeah, I started working on this, and here's what I found:

  1. writing the plugin is entirely possible without modifying any part of weechat, as the plugin API is very powerful
  2. telegram-cli in deamon mode seems a bit off or problematic: I need to poll it to get data about incoming messages etc. Especially if I have many chats open, this might create significant overhead and/or become not-so-usable. Thus, my question: am I missing some option which would allow me to just wait for incoming data and send data on occasion? Or is polling a necessary evil here which we cannot avoid? So far I haven't found anything, so I thought I'd report back.
LukeLR commented 8 years ago

You could of course enable the json mode and connect to the application, when sending the main_session command, all incoming messages will get printed to the connection output stream. So you can just parse the json, or use this as a trigger to refresh a certain chat.

On 20 May 2016, at 23:04, ibabushkin notifications@github.com wrote:

Yeah, I started working on this, and here's what I found:

  1. writing the plugin is entirely possible without modifying any part of weechat, as the plugin API is very powerful
  2. telegram-cli in deamon mode seems a bit off or problematic: I need to poll it to get data about incoming messages etc. Especially if I have many chats open, this might create significant overhead and/or become not-so-usable. Thus, my question: am I missing some option which would allow me to just wait for incoming data and send data on occasion? Or is polling a necessary evil here which we cannot avoid? So far I haven't found anything, so I thought I'd report back.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

ibabushkin commented 8 years ago

yeah, running telegram-cli in a normal mode would be a solution as well, but I can't say I'd support that one as a particularly elegant solution :D. Especially because it requires some cleanup when starting telegram-cli. Of course, one could move that to the weechat-module as well, making it pretty seamless to the user.

raedah commented 8 years ago

Related to this is that bitlbee works with weechat and provides telegram support via libpurple. See https://wiki.bitlbee.org/ for full list of supported protocols, and https://github.com/majn/telegram-purple .

proycon commented 7 years ago

I'd be very interested in a telegram plugin for weechat as well, has there been any progress on this already?

ibabushkin commented 7 years ago

I've recently paused my efforts, but I've taken them up again. Progress is being made. If you want to contribute: https://github.com/ibabushkin/swtb

NickSeagull commented 6 years ago

@ibabushkin any progress on this? I'd like to contribute :)

ibabushkin commented 6 years ago

On 2017-10-11, Nikita Tchayka wrote:

@ibabushkin any progress on this? I'd like to contribute :)

To be honest, I stopped working on this, mostly because tg itself is quite dead at this point and had various issues that made cooperating with it not as nice I wanted.

NickSeagull commented 6 years ago

Ok! Thanks :)

filisko commented 6 years ago

Any future plans to do this?

weilbith commented 6 years ago

Anyone still working on this? Have a high interest for such a plugin. Haven't work myself with the WeeChat API on my own. But if nobody is developing, seems like I have to.

ibabushkin commented 6 years ago

On 2018-02-14, Thore Weilbier wrote:

Anyone still working on this? Have a high interest for such a plugin. Haven't work myself with the WeeChat API on my own. but if nobody is developing, seems like I've to.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/vysheng/tg/issues/1097#issuecomment-365551200

My attempts pretty much died after I realized how annoying telegram-cli is to work with in such a setting. The weechat API is fairly nice to use, but I'd recommend using a different Telegram implementation.

xuzhao9 commented 4 years ago

@weilbith Sorry if it is a little off-topic. But have you tried telegramircd?

weilbith commented 4 years ago

@xuzhao9 hey, thanks for the suggestion. Can you recommend it? Do be honest I'm in a down phase regarding "fancy" communication tools on my PC. No solution is really satisfying and there are too many different protocols used. :man_shrugging:

hiliev commented 4 years ago

@weilbith I’ve used it extensively. It works for most parts but suffers from typical IRC bridge problems such as limited message length. It has a nice feature though that it makes media and documents sent over Telegram available via its built-in HTTP server. When such a message is received it spews out a unique URL for downloading the attachment. Very useable in combination with a web GUI such as Glowing Bear.