-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implemented more granular parameters for Telegram notifications #4874
Conversation
@DBa2016, thanks for your PR! By analyzing the annotation information on this pull request, we identified @askovpen, @bruno-kenji and @mjmadsen to be potential reviewers |
You know, I quite like this concept, but its association with Telegram puts me off. I really don't want (and won't use) yet another messaging application. Can I suggest you think about separating the various information-generating code from the actual message-sending code. That way, the information-generating stuff could be re-used to send notifications via other protocols, ie. email, skype, messenger etc. Eg. delivery_system = telegram/skype/whatever (obviously needs supporting code) then.. delivery_system.send_message(msg) Let the delivery_system code worry about how to delivery the message, while the rest just deals with handling events and passing them on. Just my 2 cents. Hope it makes sense. |
@Gobberwart : the original Telegram integration does not originate from me, I only adjusted the notification config and some other things. In principle, what you are suggesting makes sense, and it would involve the following:
None of these two parts is depending nor anyhow related to this PR. You are welcome to go ahead and implement your wish - I will very unlikely do because I am okay with Telegram and don't see a need for further IMs. :) |
@DBa2016 No problem, just thought I'd comment while I had the opportunity. Never know who's watching. Not something I'm planning to do anything about immediately, but if anyone wants to run with it, go nuts :) |
@Gobberwart The master setting is whom you can send for. Please check the code inside and correct me if I'm wrong. |
@solderzzc The master setting? Sorry, not following you. |
@Gobberwart this one: You can set the master to your own id, or the message will not send out. |
@solderzzc Not my point. I'd like to see alert messages able to be sent from whatever messaging system you choose.. as in...
and then...
etc. Sure I can set the Telegram id to whatever I want, but I am not interested in Telegram. I am, however, interested in an alert delivery system. |
@Gobberwart sure, get it. |
trigger = self.pokemons["all"] | ||
else: | ||
return | ||
if (not "operator" in trigger or trigger["operator"] == "and") and data["cp"] >= trigger["cp"] and data["iv"] >= trigger["iv"] or ("operator" in trigger and trigger["operator"] == "or" and (data["cp"] >= trigger["cp"] or data["iv"] >= trigger["iv"])): |
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.
There's good logic operator code in the pokemon catch worker, would you like to use that code @DBa2016
|
Does this work with "any" or "all"? |
Seems the
|
Cheers mate, I was too lazy to look :) |
Let's have it merge, leave the code fine tune later. |
@Gobberwart Do you want to try the pull approval ? |
@solderzzc Approved... do I just click "Merge pull request" now? |
yes, I think so... |
Yay! :) |
Short Description:
"alert_catch" now can be either a list as before (alert on every catch of the corresponding pokemon) or a dictionary of dictionaries, of the form:
"alert_catch": {
"PokemonName": { "operator": "and/or", "iv": 0.9, "cp": 1000}
}