Closed Techbrunch closed 8 years ago
NicknamePokemonResponse.proto says in result enum this answer corresponds to ERROR_POKEMON_NOT_FOUND = 3;
I'm getting the same issue.
For the request I was generating, I explicitly grabbed the ID from the PokemonData in the InventoryData response - not sure if a conversion needs to be made, or if there's a mapping issue in the nickname request proto, but it seems like it should be working.
Steps to reproduce:
api.get_inventory()
response_dict = api.call()
all_pokemon = filter(lambda i: i['inventory_item_data'].has_key('pokemon_data') and not i['inventory_item_data']['pokemon_data'].has_key('is_egg'), response_dict['responses']['GET_INVENTORY']['inventory_delta']['inventory_items'])
all_pokemon = map(lambda i: i['inventory_item_data']['pokemon_data'], all_pokemon)`
pokemon_ids = map(lambda p: p['id'], all_pokemon)
responses = map(lambda p: api.nickname_pokemon(pokemon_id=p, nickname='TEST').call()['responses']['NICKNAME_POKEMON'], pokemon_ids)
This returns (for the single pokemon in my inventory) {'result': 3}
any update here?
The problem seems to be the ID type.
In protos/POGOProtos/Networking/Requests/Messages_pb2.py Line 1395 I've changed "type=4" to "type=6" and it works without problems!
I'm guessing this pull request fixed the issue: https://github.com/AeonLucid/POGOProtos/pull/38 so I would look into https://github.com/tejado/pgoapi/issues/95 to fix the issue.
I'm closing this issue in favor of https://github.com/tejado/pgoapi/issues/95
@GreWull How should I pass the pokemon_id ? I always get the pokemon not found error :(
api.nickname_pokemon(pokemon_id = 13918471692738592768, nickname = 'Test')
response_dict = api.call()
print('Response dictionary: \n\r{}'.format(pprint.PrettyPrinter(indent=4).pformat(response_dict)))
@Techbrunch that's strange, I've seen you have commited the change.
This is the function I use (in the Pokemon Go Bot):
def rename_pokemon(self, pid, name):
self.api.nickname_pokemon(pokemon_id=pid, nickname=name)
response_dict = self.api.call()
The ID I use is type Long, I don't see why it shouldn't work..
@GreWull Not sure what was wrong but after updating the proto files now it works, thanks :)
I thought the protos where up to date but they still are not. So this issue is still not fixed.
What do you mean with they are not up to date?
Well this call is still not working if I don't manually compile the current protos from AeonLucid.
Edit: I'm going to try with a fresh repo Edit2:Sorry with a fresh repo it works, not sure what happened ><
I'm trying to set a nickname to one of my pokemon but it's not working, I'm using:
This is the console output:
Any idea what I'm doing wrong ?