From a4cfa42fb0870288765a214bd068ae2add513f46 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 19 Oct 2019 12:09:10 +0200 Subject: [PATCH] Add VersionCommand --- royalnet/packs/common/commands/__init__.py | 2 ++ royalnet/packs/common/commands/version.py | 14 ++++++++++++++ royalnet/version.py | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 royalnet/packs/common/commands/version.py diff --git a/royalnet/packs/common/commands/__init__.py b/royalnet/packs/common/commands/__init__.py index 89c4f4a1..46cf3b53 100644 --- a/royalnet/packs/common/commands/__init__.py +++ b/royalnet/packs/common/commands/__init__.py @@ -1,9 +1,11 @@ # Imports go here! from .ping import PingCommand +from .version import VersionCommand # Enter the commands of your Pack here! available_commands = [ PingCommand, + VersionCommand ] # Don't change this, it should automatically generate __all__ diff --git a/royalnet/packs/common/commands/version.py b/royalnet/packs/common/commands/version.py new file mode 100644 index 00000000..1a66f9e3 --- /dev/null +++ b/royalnet/packs/common/commands/version.py @@ -0,0 +1,14 @@ +from royalnet.commands import * +from royalnet.version import semantic + + +class VersionCommand(Command): + name: str = "version" + + description: str = "Get the current Royalnet version." + + async def run(self, args: CommandArgs, data: CommandData) -> None: + message = f"ℹ️ Royalnet {semantic}\n" + if "69" in message: + message += "(Nice.)" + await data.reply(message) diff --git a/royalnet/version.py b/royalnet/version.py index 4b30e4ec..9a00a37b 100644 --- a/royalnet/version.py +++ b/royalnet/version.py @@ -1 +1 @@ -semantic = "5.0a66" +semantic = "5.0a69"