From 4e6c2d9ed36b3ff1c094179c0933f85f8f6df28b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 28 Jun 2020 23:52:20 +0200 Subject: [PATCH] publish: 5.9.2 --- pyproject.toml | 2 +- royalpack/commands/eat.py | 2 +- royalpack/stars/__init__.py | 2 ++ royalpack/stars/api_user_ryg_list.py | 23 +++++++++++++++++++++++ royalpack/version.py | 2 +- 5 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 royalpack/stars/api_user_ryg_list.py diff --git a/pyproject.toml b/pyproject.toml index fb6f005b..44a977ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ [tool.poetry] name = "royalpack" - version = "5.9.1" + version = "5.9.2" description = "A Royalnet command pack for the Royal Games community" authors = ["Stefano Pigozzi "] license = "AGPL-3.0+" diff --git a/royalpack/commands/eat.py b/royalpack/commands/eat.py index e24498b6..a9766fcb 100644 --- a/royalpack/commands/eat.py +++ b/royalpack/commands/eat.py @@ -95,7 +95,7 @@ class EatCommand(Command): "gelato di steffo": "🍨 Hai provato a rubare il {food}...\n[i]...Ma sei arrivato tardi: l'ha già mangiato.[/i]", "biscotto": "🍪 Hai mangiato un {food} di contrabbando.\n[i]L'Inquisizione non lo saprà mai![/i]", "biscotti": "🍪 Hai mangiato tanti {food} di contrabbando.\n[i]Attento! L'Inquisizione è sulle tue tracce![/i]", - "crocchette di pollo": "🍗 Hai mangiato {food]!\n[i]Dio porco maledetto, infame, CAPRA, porca Madonna, Dio cane, " + "crocchette di pollo": "🍗 Hai mangiato {food}!\n[i]Dio porco maledetto, infame, CAPRA, porca Madonna, Dio cane, " "HAI PERSO. UN POMERIGGIO PER C- ooh se è questo dio cane, altro che sfondamento dei cieli " "*roba non capibile*, sfondi tutti dio can li distruggi, non ci rimane più niente.[/i]", diff --git a/royalpack/stars/__init__.py b/royalpack/stars/__init__.py index 7f6ec461..429f8969 100644 --- a/royalpack/stars/__init__.py +++ b/royalpack/stars/__init__.py @@ -11,6 +11,7 @@ from .api_poll_list import ApiPollsListStar from .api_cvstats_latest import ApiCvstatsLatestStar from .api_cvstats_avg import ApiCvstatsAvgStar from .api_user_ryg import ApiUserRygStar +from .api_user_ryg_list import ApiUserRygListStar # Enter the PageStars of your Pack here! available_page_stars = [ @@ -26,6 +27,7 @@ available_page_stars = [ ApiCvstatsLatestStar, ApiCvstatsAvgStar, ApiUserRygStar, + ApiUserRygListStar, ] # Don't change this, it should automatically generate __all__ diff --git a/royalpack/stars/api_user_ryg_list.py b/royalpack/stars/api_user_ryg_list.py new file mode 100644 index 00000000..13dba55b --- /dev/null +++ b/royalpack/stars/api_user_ryg_list.py @@ -0,0 +1,23 @@ +from starlette.responses import * +import royalnet.utils as ru +import royalnet.backpack.tables as rbt +import royalnet.constellation.api as rca + + +class ApiUserRygListStar(rca.ApiStar): + path = "/api/user/ryg/list/v1" + + tags = ["user"] + + @rca.magic + async def get(self, data: rca.ApiData) -> ru.JSON: + """Get Royalpack information about all user.""" + users: typing.List[rbt.User] = await ru.asyncify(data.session.query(self.alchemy.get(rbt.User)).all) + return [{ + **user.json(), + "bio": user.bio.json() if user.bio is not None else None, + "fiorygi": user.fiorygi.fiorygi if user.fiorygi is not None else None, + "steam": [steam.json() for steam in user.steam], + "leagueoflegends": [leagueoflegends.json() for leagueoflegends in user.leagueoflegends], + "trivia": user.trivia_score.json() if user.trivia_score is not None else None + } for user in users] diff --git a/royalpack/version.py b/royalpack/version.py index 6c855539..62374c71 100644 --- a/royalpack/version.py +++ b/royalpack/version.py @@ -1 +1 @@ -semantic = "5.9.1" +semantic = "5.9.2"