2020-04-29 21:54:01 +00:00
|
|
|
|
from typing import *
|
2020-05-10 22:46:12 +00:00
|
|
|
|
|
2020-07-31 14:11:08 +00:00
|
|
|
|
import functools
|
2020-07-22 23:32:21 +00:00
|
|
|
|
import pkg_resources
|
|
|
|
|
import royalnet.commands as rc
|
2020-04-29 21:54:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RoyalpackCommand(rc.Command):
|
2020-07-02 19:40:33 +00:00
|
|
|
|
name: str = "royalpackversion"
|
2020-04-29 21:54:01 +00:00
|
|
|
|
|
|
|
|
|
description: str = "Visualizza la versione attuale di Royalpack."
|
|
|
|
|
|
|
|
|
|
syntax: str = ""
|
|
|
|
|
|
2020-07-22 23:32:21 +00:00
|
|
|
|
@property
|
2020-07-31 14:11:08 +00:00
|
|
|
|
@functools.lru_cache(1)
|
|
|
|
|
def royalpack_version(self) -> str:
|
2020-07-22 23:32:21 +00:00
|
|
|
|
return pkg_resources.get_distribution("royalpack").version
|
|
|
|
|
|
2020-04-29 21:54:01 +00:00
|
|
|
|
async def run(self, args: rc.CommandArgs, data: rc.CommandData) -> None:
|
2020-08-20 01:20:53 +00:00
|
|
|
|
message = f"ℹ️ Royalpack [url=https://github.com/Steffo99/royalpack/releases/tag/{self.royalpack_version}]{self.royalpack_version}[/url]\n"
|
2020-07-23 00:02:20 +00:00
|
|
|
|
if "69" in self.royalpack_version:
|
2020-04-29 21:54:01 +00:00
|
|
|
|
message += "(Nice.)"
|
|
|
|
|
await data.reply(message)
|