1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00
royalnet/royalpack/commands/royalpackversion.py

25 lines
826 B
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from typing import *
import pkg_resources
import royalnet.commands as rc
class RoyalpackCommand(rc.Command):
name: str = "royalpackversion"
description: str = "Visualizza la versione attuale di Royalpack."
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/{self.royalpack_version}]{self.royalpack_version}[/url]\n"
if "69" in semantic:
message += "(Nice.)"
await data.reply(message)