diff --git a/pyproject.toml b/pyproject.toml index 27278001..9dbe6bf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ [tool.poetry] name = "royalpack" - version = "5.13.2" + version = "5.13.4" description = "A Royalnet command pack for the Royal Games community" authors = ["Stefano Pigozzi "] license = "AGPL-3.0+" diff --git a/royalpack/commands/royalpackversion.py b/royalpack/commands/royalpackversion.py index bbd514ae..f2b17584 100644 --- a/royalpack/commands/royalpackversion.py +++ b/royalpack/commands/royalpackversion.py @@ -1,7 +1,7 @@ from typing import * -import royalnet.commands as rc -from ..version import semantic +import pkg_resources +import royalnet.commands as rc class RoyalpackCommand(rc.Command): @@ -11,11 +11,15 @@ class RoyalpackCommand(rc.Command): syntax: str = "" + @property + def royalpack_version(self): + return pkg_resources.get_distribution("royalpack").version + async def run(self, args: rc.CommandArgs, data: rc.CommandData) -> None: if __debug__: message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/]Unreleased[/url]\n" else: - message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/releases/tag/{semantic}]{semantic}[/url]\n" + message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/releases/tag/{self.royalpack_version}]{self.royalpack_version}[/url]\n" if "69" in semantic: message += "(Nice.)" await data.reply(message) diff --git a/royalpack/version.py b/royalpack/version.py deleted file mode 100644 index 4430300e..00000000 --- a/royalpack/version.py +++ /dev/null @@ -1,3 +0,0 @@ -import pkg_resources - -semantic = pkg_resources.get_distribution("royalpack").version