rubenmak / PokemonGo-SlackBot

Receive Slack notification whenever a Pokémon spawns near a given location
MIT License
99 stars 29 forks source link

No support for lured pokemon #16

Closed danopia closed 8 years ago

danopia commented 8 years ago

Right now the bot reports "wild" pokemon, which are random based on biome. It doesn't report lured pokemon which belong to pokestops (the pokemon do not have coordinates) and rotate out every 3 minutes while a lure is hot (~10 per lure). This info is definitely in the API.

For my PoC I observed which API pokestop had the same pokemon as the desired actual pokestop, then hardcoded the ID. I'm not strong at Python so I can't provide a proper PR for the feature

danopia commented 8 years ago

This is my PoC, assuming a global variable atStop and going inside the "is pokestop" check

if Fort.LureInfo and Fort.LureInfo.FortId == "asdfasdfasdfasdfasdfasdfasdf.asdf":
    if Fort.LureInfo.ActivePokemonId != atStop:
        atStop = Fort.LureInfo.ActivePokemonId
        alert_text = "I was lured to the pokestop for a few minutes!"
        pokename = pokemonsJSON[str(atStop)]
        if not pokename.lower() in ignore:
            send_to_slack(alert_text, pokename, pokename.lower(), slack_webhook_urlpath)
rubenmak commented 8 years ago

Thanks for the tip! I justed pushed the script to master :)