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
feat: twitch chat notification, multiple telegram chat ids and german web shop overhaul #528
Conversation
i think i came up with a good workaround: no need to wrap the instantiation of Please let me know what you think :) |
THIS IS AWESOME |
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.
HOLY smokes that's a lot of products... Thanks for the great add. I have a few comments there, but that shouldn't hold back this PR any futher.
Thanks for implementing this!
I don't know all of the use cases for Twitch, but I also don't use it that often, so if it makes sense, then great!
logger.error('✖ couldn\'t send telegram message', error); | ||
for (const chatId of telegram.chatId) { | ||
try { | ||
results.push(client.sendMessage(chatId, `${Print.inStock(link, store)}\n${givenUrl}`)); |
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.
we should make this async
as well. But that's OK, we can do that in another PR.
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.
line 16 - 30 is already wrapped in an async
, do you mean the body of the for loop should be async
aswell?
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.
Oh, I mean that we should wrap with Promise
or something.
Kind of like this:
But I don't even know if sendMessage
returns a Promise
, so I really don't know if this would work.
If you're able to resolve these conflicts, we can get this in! Thank you! |
There seems to be an error when checking the zotac card on MediaMarkt and Saturn store:
|
I saw a streamer on twitch who is streaming this project for the na/ca market, i thought it would be good idea to do this for the german market as well. |
that sounds great. is he streaming 24/7? do you have a link? |
as far as i know, 24/7 stream for na/ca: https://www.twitch.tv/falcodrin |
asus store gives me error, i think they changed some stuff on their shop. |
Thank you very much! |
Description
Resolves #530
feat: allow multiple telegram chats to be notified
feat: add notifications to twitch channel chats
feat: add computeruniverse (de)
feat: add cyberport (de) shop
feat: add mindfactory (de) shop
feat: add saturn (de) shop (see @fubu2k's pr)
chore: normalize model names for various german stores
chore: add and sort links for various german stores
chore: removed dead links from various german stores
chore: shortened links for proshop-de
sorry for this huge pr, i somehow forgot to create one after each feature as i was constantly adding and testing.
Testing
telegram notifications work this way for either a single chat id or comma seperated chat ids,
as
telegram.chatId.split(',')
returns the original string if no comma is found.tested twitch notifications and found this way to be most stable. first i tried to only connect in an event of an alert and
immediately disconnect when the message got sent, but this introduced some weird behavior and the
ChatClient
withthe
RefreshableAuthProvider
should maintain the connection or reconnect in case of an connection loss.the setup of this notification method is a bit laborious though, maybe this should be mentioned in the README.
i'm open for discussion on this one and would like to hear your opinion.
i found it to be more reliable to check for
outOfStock
instead ofinStock
for most german webshops, as they rarely list new items as "in stock" rather than more something like "available in x days" and accept preorders, so they don't even get to the "in stock" state.New dependencies
"twitch": "^4.2.6"
,"twitch-auth": "^4.2.6"
,"twitch-chat-client": "^4.2.6"