pokelance.ext.contest
⚓︎
Contest(client)
⚓︎
Bases: BaseExtension
Extension for contest related endpoints.
Attributes: |
|
---|
Initializes the extension.
Parameters: |
|
---|
Returns: |
|
---|
Source code in pokelance/ext/_base.py
fetch_contest_effect(id_)
async
⚓︎
Fetches a contest effect from the API.
Parameters: |
|
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> import asyncio
>>> client = PokeLance()
>>> async def main() -> None:
... effect = await client.contest.fetch_contest_effect(1)
... print(effect.appeal)
... await client.close()
>>> asyncio.run(main())
4
Source code in pokelance/ext/contest.py
fetch_contest_type(name)
async
⚓︎
Fetches a contest type from the API.
Parameters: |
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> import asyncio
>>> client = PokeLance()
>>> async def main() -> None:
... type_ = await client.contest.fetch_contest_type("cool")
... print(type_.name)
... await client.close()
>>> asyncio.run(main())
cool
Source code in pokelance/ext/contest.py
fetch_super_contest_effect(id_)
async
⚓︎
Fetches a super contest effect from the API.
Parameters: |
|
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> import asyncio
>>> client = PokeLance()
>>> async def main() -> None:
... effect = await client.contest.fetch_super_contest_effect(1)
... print(effect.appeal)
... await client.close()
>>> asyncio.run(main())
2
Source code in pokelance/ext/contest.py
get_contest_effect(id_)
⚓︎
Gets a contest effect from the cache.
Parameters: |
|
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> client = PokeLance()
>>> effect = client.contest.get_contest_effect(1) # None if not cached
>>> effect.appeal
4
Source code in pokelance/ext/contest.py
get_contest_type(name)
⚓︎
Gets a contest type from the cache.
Parameters: |
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> client = PokeLance()
>>> type_ = client.contest.get_contest_type("cool") # None if not cached
>>> type_.name
'cool'
Source code in pokelance/ext/contest.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
get_super_contest_effect(id_)
⚓︎
Gets a super contest effect from the cache.
Parameters: |
|
---|
Returns: |
|
---|
Raises: |
|
---|
Examples:
>>> from pokelance import PokeLance
>>> client = PokeLance()
>>> effect = client.contest.get_super_contest_effect(1)
>>> effect.appeal
2
Source code in pokelance/ext/contest.py
setup()
async
⚓︎
Sets up the extension.