From 3d7b861e52463b289c5351ee2b93d10ccc09871f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 23 Jul 2020 02:02:20 +0200 Subject: [PATCH] Fix bugs --- poetry.lock | 14 +++++++++++++- pyproject.toml | 3 ++- royalpack/commands/osu.py | 10 ++++++++++ royalpack/commands/royalpackversion.py | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index 378d7827..1d194772 100644 --- a/poetry.lock +++ b/poetry.lock @@ -272,6 +272,14 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" version = "2.10" +[[package]] +category = "main" +description = "Various helpers to pass data to untrusted environments and back." +name = "itsdangerous" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "1.1.0" + [[package]] category = "main" description = "multidict implementation" @@ -713,7 +721,7 @@ python-versions = "*" version = "2020.6.16.1" [metadata] -content-hash = "6186dd82fb955af7343f43eaddc27c2eb6b9abe24b53e34bc41891e264658a89" +content-hash = "bd3b2b2a3ab95481b04d72980ab5365028e6aee69b12e395b0c4cbdfde95c452" lock-version = "1.0" python-versions = "^3.8" @@ -882,6 +890,10 @@ idna = [ {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, ] +itsdangerous = [ + {file = "itsdangerous-1.1.0-py2.py3-none-any.whl", hash = "sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749"}, + {file = "itsdangerous-1.1.0.tar.gz", hash = "sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19"}, +] multidict = [ {file = "multidict-4.7.6-cp35-cp35m-macosx_10_14_x86_64.whl", hash = "sha256:275ca32383bc5d1894b6975bb4ca6a7ff16ab76fa622967625baeebcf8079000"}, {file = "multidict-4.7.6-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:1ece5a3369835c20ed57adadc663400b5525904e53bae59ec854a5d36b39b21a"}, diff --git a/pyproject.toml b/pyproject.toml index 9dbe6bf6..4b03028e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ [tool.poetry] name = "royalpack" - version = "5.13.4" + version = "5.13.6" description = "A Royalnet command pack for the Royal Games community" authors = ["Stefano Pigozzi "] license = "AGPL-3.0+" @@ -25,6 +25,7 @@ steam = "*" sqlalchemy = "^1.3.18" bcrypt = "^3.1.7" + itsdangerous = "^1.1.0" [tool.poetry.dependencies.royalnet] version = "~5.10.4" diff --git a/royalpack/commands/osu.py b/royalpack/commands/osu.py index dff74519..ce0dedfb 100644 --- a/royalpack/commands/osu.py +++ b/royalpack/commands/osu.py @@ -123,3 +123,13 @@ class OsuCommand(LinkerCommand): await self.notify(f"⬜️ [b]{obj.user}[/b] non è più classificato su [i]osu!catch[/i].") elif attribute == "mania_pp": await self.notify(f"⬜️ [b]{obj.user}[/b] non è più classificato su [i]osu!mania[/i].") + + def describe(self, obj: Osu) -> str: + message = [ + f"ℹ️ [url=https://osu.ppy.sh/users/{obj.osu_id}]{obj.username}[/url]", + f"osu!: [b]{obj.standard_pp:.0f}pp[/b]", + f"osu!taiko: [b]{obj.taiko_pp:.0f}pp[/b]", + f"osu!catch: [b]{obj.catch_pp:.0f}pp[/b]", + f"osu!mania: [b]{obj.mania_pp:.0f}pp[/b]", + ] + return "\n".join(message) diff --git a/royalpack/commands/royalpackversion.py b/royalpack/commands/royalpackversion.py index f2b17584..b397987c 100644 --- a/royalpack/commands/royalpackversion.py +++ b/royalpack/commands/royalpackversion.py @@ -20,6 +20,6 @@ class RoyalpackCommand(rc.Command): message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/]Unreleased[/url]\n" else: message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/releases/tag/{self.royalpack_version}]{self.royalpack_version}[/url]\n" - if "69" in semantic: + if "69" in self.royalpack_version: message += "(Nice.)" await data.reply(message)