From a91e61b84c2b485edd3786aa0d31645b130d39ab Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Sun, 22 Dec 2019 05:33:18 +0000 Subject: Add support for transformation/translation modules that do arbitrary request processing to generate the message Fixes #3 --- config.example.toml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config.example.toml') diff --git a/config.example.toml b/config.example.toml index 7c2ff18..1861ef4 100644 --- a/config.example.toml +++ b/config.example.toml @@ -22,3 +22,5 @@ #ircchannel = '#spam' # auth can be either 'user:pass' for basic authentication or false to disable auth #auth = false + # module is the path to a Python source file that handles the message transformation. It must contain a coroutine function 'process' that takes one argument, the aiohttp.web.Request object, and returns the message string to be sent to IRC, which must not contain any linebreaks (CR or LF). It may raise an aiohttp.web.HTTPException to stop processing; any other exception will also cause the processing to be stopped and a '400 Bad Request' response to be returned to the client. The empty default value (None) causes the default processor to be used, which expects a straight message in the request body (with an optional trailing CR+LF or LF) and performs no transformations other than encoding the message as UTF-8. + #module = -- cgit v1.3.1-10-gc9f91