I’m creating a chat bot manager in python, where myself (or other developers) can provide a configuration file to the manager and it will generate a bot depending on what it found in the config.
The chat bot manager is generally for monitoring different services, and then performing some sort of action depending on what it finds while monitoring. Ideally, I’d have something that looks like the following:
[
{
triggerURL: "www.foobar.com/some/health/check",
triggerMethod: "GET"
healthyStatusCodes: [200, 202],
healthyResponseBody: "{"status":"ok"}",
healthyCallback: () => console.log("do something here"),
unhealthyCallback: () => console.log("do something else here")
}
]
You might notice my example is a little JS-esque.
Is there a way I can embed javascript into a python program to accomplish what I want?
Are there any other alternatives that do something similar? I’d like to keep the amount of clutter in the configuration file to a minimum, and would like to avoid future developers needing to write any extra code to get it working.