pokelance.ext.encounter
⚓︎
Encounter(client)
⚓︎
Bases: BaseExtension
Extension for encounter related endpoints.
Attributes: |
|
---|
Initializes the extension.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pokelance/ext/_base.py
fetch_encounter_condition(name)
async
⚓︎
Fetches an encounter condition from the API.
Parameters: |
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> import asyncio
>>> client = PokeLance()
>>> async def main() -> None:
... condition = await client.encounter.fetch_encounter_condition("swarm")
... print(condition.name)
... await client.close()
>>> asyncio.run(main())
swarm
Source code in pokelance/ext/encounter.py
fetch_encounter_condition_value(name)
async
⚓︎
Fetches an encounter condition value from the API.
Parameters: |
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> import asyncio
>>> client = PokeLance()
>>> async def main() -> None:
... condition = await client.encounter.fetch_encounter_condition_value("swarm-yes")
... print(condition.name)
... await client.close()
>>> asyncio.run(main())
swarm-yes
Source code in pokelance/ext/encounter.py
fetch_encounter_method(name)
async
⚓︎
Fetches an encounter method from the API.
Parameters: |
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> import asyncio
>>> client = PokeLance()
>>> async def main() -> None:
... method = await client.encounter.fetch_encounter_method("walk")
... print(method.name)
... await client.close()
>>> asyncio.run(main())
walk
Source code in pokelance/ext/encounter.py
get_encounter_condition(name)
⚓︎
Gets an encounter condition from the cache.
Parameters: |
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> client = PokeLance()
>>> condition = client.encounter.get_encounter_condition("swarm")
>>> condition.name
'swarm'
Source code in pokelance/ext/encounter.py
get_encounter_condition_value(name)
⚓︎
Gets an encounter condition value from the cache.
Parameters: |
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> client = PokeLance()
>>> condition = client.encounter.get_encounter_condition_value("swarm-yes")
>>> condition.name
'swarm-yes'
Source code in pokelance/ext/encounter.py
get_encounter_method(name)
⚓︎
Gets an encounter method from the cache.
Parameters: |
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> client = PokeLance()
>>> method = client.encounter.get_encounter_method("walk")
>>> method.name
'walk'
Source code in pokelance/ext/encounter.py
get_message(case, data)
staticmethod
⚓︎
Gets the error message for a resource not found error.
Parameters: |
---|
Returns: |
|
---|
Source code in pokelance/ext/_base.py
setup()
async
⚓︎
Sets up the extension.