From a530272408b04d0715713b77ae6590a35c632cd5 Mon Sep 17 00:00:00 2001 From: dymik739 Date: Sun, 1 Oct 2023 22:34:39 +0300 Subject: [PATCH] add new module: generic-command-processor --- modules/generic-command-processor/data.json | 3 +++ modules/generic-command-processor/index.py | 6 ++++++ modules/generic-command-processor/meta.json | 6 ++++++ 3 files changed, 15 insertions(+) create mode 100644 modules/generic-command-processor/data.json create mode 100644 modules/generic-command-processor/index.py create mode 100644 modules/generic-command-processor/meta.json diff --git a/modules/generic-command-processor/data.json b/modules/generic-command-processor/data.json new file mode 100644 index 0000000..ab44c23 --- /dev/null +++ b/modules/generic-command-processor/data.json @@ -0,0 +1,3 @@ +{ + "s": "Головна сторінка сервера: http://10.1.1.1:12010/" +} diff --git a/modules/generic-command-processor/index.py b/modules/generic-command-processor/index.py new file mode 100644 index 0000000..6a0d4cf --- /dev/null +++ b/modules/generic-command-processor/index.py @@ -0,0 +1,6 @@ +command_storage = json.loads(open(self.path + "data.json").read()) + +received_command = self.MESSAGE.text[1:] + +if received_command in command_storage: + self.RESPONSE = command_storage[received_command] diff --git a/modules/generic-command-processor/meta.json b/modules/generic-command-processor/meta.json new file mode 100644 index 0000000..5daefdd --- /dev/null +++ b/modules/generic-command-processor/meta.json @@ -0,0 +1,6 @@ +{ + "version": 1, + "index_file": "index.py", + "start_on_boot": true, + "alias": "generic-command-processor" +}