mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
Fix royalpackversion.py not printing the version
This commit is contained in:
parent
64f517ea62
commit
0d1757f4c8
1 changed files with 5 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
from typing import *
|
from typing import *
|
||||||
|
|
||||||
|
import functools
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
import royalnet.commands as rc
|
import royalnet.commands as rc
|
||||||
|
|
||||||
|
@ -12,14 +13,16 @@ class RoyalpackCommand(rc.Command):
|
||||||
syntax: str = ""
|
syntax: str = ""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def royalpack_version(self):
|
@functools.lru_cache(1)
|
||||||
|
def royalpack_version(self) -> str:
|
||||||
return pkg_resources.get_distribution("royalpack").version
|
return pkg_resources.get_distribution("royalpack").version
|
||||||
|
|
||||||
async def run(self, args: rc.CommandArgs, data: rc.CommandData) -> None:
|
async def run(self, args: rc.CommandArgs, data: rc.CommandData) -> None:
|
||||||
|
# noinspection PyUnreachableCode
|
||||||
if __debug__:
|
if __debug__:
|
||||||
message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/]Unreleased[/url]\n"
|
message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/]Unreleased[/url]\n"
|
||||||
else:
|
else:
|
||||||
message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/releases/tag/{self.royalpack_version}]{self.royalpack_version}[/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:
|
if "69" in self.royalpack_version:
|
||||||
message += "(Nice.)"
|
message += "(Nice.)"
|
||||||
await data.reply(message)
|
await data.reply(message)
|
||||||
|
|
Loading…
Reference in a new issue