Jump to content

Telegram Notifications Plugin


darkside40

Recommended Posts

darkside40

thumb.png.0c05c2bbb45415af050599c52d379747.png

Telegram Notifications Plugin for Emby

Finally after using it by myself for over 3,5 years and "supporting" it in another Thread https://emby.media/community/index.php?/topic/42912-telegram-notification/ i decided that with the latest Version it would be good to have a destinct Plugin Thread for it. Nope it is not in the Plugin catalog, because there are only plugins by developers which are "willing to fully support it.  That means keep it up to date with server versions as well as fix any issues and respond to user help requests." Because of the closed source code of Emby and the lack of Plugin development documentation that is something i cannot ensure.

What it does?

 

It simply forwards the Messages of the Emby Notification Framework to a Chat or Channel. Not more, not less. Sorry no fancy posters etc. because the Standard Notifications of Emby dont support it.  That could be hacked into, but those things can break easily on every update and i dont want to spend more work on this.

How to install?

  1. Install the Plugin by downloading the DLL (or build it yourself using VS2019) and putting it into your Emby Plugin folder
  2. Restart your Emby Server
  3. Talk to @Bodfather with your favorite Telegram Client to create your Telegram Bot
  4. Start a chat with your bot (or place it in a channel) and send a message to it
  5. Fire up your browser and type the following URL: https://api.telegram.org/bot<BotTokenGoesHere>/getUpdates (without the braces) and find the ChatID
  6. Use the Settings Page of the Plugin to set Bot Token and Chat ID
  7. Activate the Telegram Notifications Plugin in the desired Server notifications

Known Issues?

There are no issues with the Plugin itself because it is really simple. The problems are inside the Emby Notification Framework for example if you want to use it to keep your Family and Friends up-to-dat with the newest Additions to your server. For every scan Emby only sends 10x New Media Notifications so if you add 100 Movies you only get the first 10 send to you. That is something that should have been worked on for quite some time but nothing happened. 

Where to get it?

You can download the Source and DLL on Github or attached to this thread.

https://github.com/bjoerns1983/Emby.Plugin.TelegramNotification/releases

Have fun with it. If you have a cool idea simply open a Github Issue.

To be honest i dont know how long this Plugin will be maintained. I mean it works since nearly four years without any problems. I am really waiting for the New Notification Webhook feature which would make these kind of notifications way more easy.

Emby.Plugin.TelegramNotification.dll

  • Like 3
  • Thanks 2
Link to comment
Share on other sites

  • 2 weeks later...
TJSNHS04

This happens when new movie episodes are added

 

This and with more than 4 episodes

test1.png

This is with less than or equal to 4 episodes

test2.png

Same thing for the movies

Edited by TJSNHS04
Link to comment
Share on other sites

darkside40

Thats a limitation of the Emby Notification Framework, just like the fact that you only get 10 results per Scan.

Nothing i can do about it without writing a completely new plugin, without any developer documentation, without knowing how long it lasts.

Link to comment
Share on other sites

  • 3 weeks later...

Hi, 

Thanks for an awesome plugin!.

I've just installed it and got it working for sending notifications from the bot directly to me.

How do I set it up to post to a channel instead of a direct message?

I have added the bot to my channel as an admin and set the Channels id as reported by @get_id_bot.

Link to comment
Share on other sites

4 hours ago, darkside40 said:

Than it should work.

Pay attention that you have the correct chat id which starts with -100 if it is a channel.

Legend I had missed the minus(-)

  • Haha 1
Link to comment
Share on other sites

  • 1 month later...

Hello. I'm using the plugin and it works great in conjunction with the Playback Reporting plugin. Thanks for making it available. Is there any way to translate/change the title and other terms of the notification?

Link to comment
Share on other sites

Anthony Musgrove

Hey @darkside40 - thank you so much for the inspiration for including a Telegram package in ScripterX, check out the last post on https://emby.media/community/index.php?/topic/84816-new-plugin-custom-scripting-emby-scripterx/page/22/

All inspired by this thread and your awesome idea for a plugin.  Thank you!

scripterxbot.jpg

tg_package_javascript.png

tgnotification_package_installed.png

  • Thanks 1
Link to comment
Share on other sites

darkside40
On 4/21/2022 at 1:53 PM, kirkj said:

Hello. I'm using the plugin and it works great in conjunction with the Playback Reporting plugin. Thanks for making it available. Is there any way to translate/change the title and other terms of the notification?

Unfortunately not. This plugin only passes the messages coming from the Emby Messaging Framework.

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
caffeineshock

heyho

first, i want to say "vielen dank für das plugin". i was really suprised as i found this thread and that this plugin already exists (and its not part of emby lol^^)

anyway, the plugins behaviour is somehow unpredictable.

sometimes i get a notification with the movie title + description. the next time i get just the name. both acceptable.

but sometimes i get the filename. looks like the notification is send before the movie is identified.

is this because of the plugin on because of emby? can it somehow be made more consistent?

Link to comment
Share on other sites

darkside40

First of all it is nice to hear that the Plugin is useful for you.

The simple problem is that this unpredictable behaviour is not part of the plugin but of the Emby notification frameword. The Plugin just passes on the messages. The problem that you only get the filename is known an i could be solved quite easily by emby checking if there is a description before forwarding the notification.

But to be honest, the notification framework has not improved over the past years, on some points its even got worse and i gave up pointing the Emby Team to those issues.

My workflow is a bit different, i use the Playback Reporting Plugin which also has a notification function. I add my content, check if everything is recognized correctly and after that i use the playback reportings plugin notification manually.

Link to comment
Share on other sites

  • 4 weeks later...
caffeineshock

nvm, solved the problem. nothing todo with the telegram plugin.

somehow emby changed somedirectories and idk why but that has nothing todo with this

Edited by caffeineshock
issue found
Link to comment
Share on other sites

10 hours ago, caffeineshock said:

nvm, solved the problem. nothing todo with the telegram plugin.

somehow emby changed somedirectories and idk why but that has nothing todo with this

HI, what directories do you mean?

Link to comment
Share on other sites

caffeineshock
13 hours ago, Luke said:

HI, what directories do you mean?

somehow, and i dont know why, there was a new libary with the directory of my temp. encode path

my default paths are Z:\Movies, Shows, etc

my encode path is A:\Temp. 

i am the only admin and i did not change any libary settings for months. one day random telegram messages appeared: "3A7193_101 wurde Emby Server hinzugefügt", which is german for "...was added to emby server"

i took me a while to find out that there was a new libary entry (who could have guessed?) which pointed to the temp path. this explained why the telegram bot sent this strange messages.

 

Link to comment
Share on other sites

13 hours ago, caffeineshock said:

somehow, and i dont know why, there was a new libary with the directory of my temp. encode path

my default paths are Z:\Movies, Shows, etc

my encode path is A:\Temp. 

i am the only admin and i did not change any libary settings for months. one day random telegram messages appeared: "3A7193_101 wurde Emby Server hinzugefügt", which is german for "...was added to emby server"

i took me a while to find out that there was a new libary entry (who could have guessed?) which pointed to the temp path. this explained why the telegram bot sent this strange messages.

 

OK not how that would have happened but I would just remove them. Thanks.

Link to comment
Share on other sites

  • 3 months later...
caffeineshock

he says "please add an option to receive images"

thats why he posted a message from a telegram bot from emby and jellyfin where the second one does provide a cover in addition to the title

but yeah, use english (or at least german so the creator of the addon understands you lol)

Link to comment
Share on other sites

darkside40

Already guessed that but posting in a completely different language in an english forum is no good style.

Nevertheless there will be no Images in this Plugin until Emby changes the notification framework. Like i already said: It only forwards what it gets from there.

I guess Jelly has a more advanced notification framework, because their plugin does the same like mine. But thats in the closed source part of Emby, so nothing i can do. And i definately wont implement this so it breaks with the next release of Emby.

Link to comment
Share on other sites

The notification system is about to get revamped as part of this:

There will be breaking changes you'll have to adjust to, but ultimately you'll have more data at your disposal, including the original library item in the event you want to supply an image.

Link to comment
Share on other sites

GrimReaper
1 hour ago, svyaznoy362 said:

Hello. On 4.8.0.13, the task stopped working when adding a new element

 

On 10/19/2022 at 10:23 PM, Luke said:

The notification system is about to get revamped as part of this:

There will be breaking changes you'll have to adjust to, but ultimately you'll have more data at your disposal, including the original library item in the event you want to supply an image.

 

On 10/20/2022 at 11:45 PM, Luke said:

OK this is included in the beta server 4.8.0.13+, so you'll need that in order to try it out. It may also get backported to a 4.7 stable release but that's undecided as of now.

Even more event have been added beyond the ones in this screenshot, and that's because ultimately the work done here is going to serve as the basis for a revamp of the server notifications system.

 

Link to comment
Share on other sites

svyaznoy362
5 minutes ago, GrimReaper said:

Hello there!

 

Check if it is possible to include pictures (not supported by Emby atm)

 

There are possible to send via sendPhoto api with photo url.

Emby it show without auth like

http://server_url/emby/Items/Item.Id/Images/Primary

So if you can bind on http port and get movie\show ID you can provide image to telegram.

Great if plugin will have new cusom field [server url]

 

bjoerns1983 commented 5 days ago

PR welcome if you like.
I have already checked it and the Emby notification framework does not support it.
Thats means the complete Plugin need to be rewritten and regulary updated to pull the data by itself.
I wont put that much affort in a plugin for a closed source product.

Maybe the new Webhooks are a solution.

5 minutes ago, GrimReaper said:

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...