Marc-Vieg / ServerStats

Telegram bot which provides the server statistics and monitoring feature to notify you of the critical events. In development! Please feel free to contribute!:)
2 stars 1 forks source link

Telepot skeleton #3

Closed CyColm closed 2 years ago

CyColm commented 2 years ago

This is a skeleton that allows you to create a telegram bot. You need to create menu in menu.json. Each item is a menu with options. When you add function, the next item is the botTools method you want to run. Be careful to the spelling ! You can add entry parameters by adding elements You can waiting a manual parameters by adding "waiting values": "message", at the same level that "function" item.

Example with all cases :

{
    "menu": {
        "option 1": {
            "waiting values": "Please send a numeric value between 1 and 100 : ",
            "function": {
                "botTools_method_1": {
                    "args": {
                        "arg_name_in_method': {}
                    }
                }
            }
        },
        "option 2": {
            "function": {
                "botTools_method_2": {
                    "args": {
                        "value": 2
                    }
                }
            }
        },
        "option 3": {
            "function": {
                "botTools_method_3": {}
            }
        }
    }
}

You need to create functionalities by adding botTools methods. Please, respect menu spelling ! You can call them in Routine.actions() too.