-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Update the Telegram adapter to add a rich message option with a photo #106
Update the Telegram adapter to add a rich message option with a photo #106
Conversation
8dfbdf7
to
2244eaa
Compare
Hi @orangecoding, could you review the PR? Thanks! |
lib/notification/adapter/telegram.js
Outdated
} | ||
|
||
const sendTelegramMessage = (token, chatId, message, isPhoto = false, photoUrl = '') => { | ||
const url = isPhoto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think a simple if/else would be easier to read here..
- The api endpoint /sendPhoto works like /sendMessage, but it can inlcude a photo url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, @orangecoding; I replaced the ternary operator. As for the API calls, there are some differences, but for the scope of this project, you're absolutely right - they work identically with only photo URL disparity
lib/provider/kleinanzeigen.js
Outdated
@@ -25,6 +25,7 @@ const config = { | |||
link: '.aditem-main .text-module-begin a@href | removeNewline | trim', | |||
description: '.aditem-main p:not(.text-module-end) | removeNewline | trim', | |||
address: '.aditem-main--top--left | trim | removeNewline', | |||
image: '.aditem-image .imagebox img@src', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding this for the other providers as well, at least where it is available?
@ivanovvladi Thanks mate, I have added 2 comments. Sorry it took a while.. |
05044ca
to
f60eb0f
Compare
@ivanovvladi have you read my second comment about adding the photo to all provider? |
Hi, @orangecoding; thanks for the heads-up; I missed the comment. I will update leftover providers as soon as I get time |
This PR has been automatically marked as stale due to inactivity. |
Closing this PR due to prolonged inactivity. |
That PR updates the Telegram adapter and adds a rich message option with a photo.
It also updates a predefined example.
Note: the PR adds image parsing for immobilienscout24, kleinanzeigen, 1a-immobilienmarkt.