local plugin = {} local config = {} function plugin.init(ctx, options) config = options end function plugin.on_request(ctx, request) local body = host.json.decode(request.body) if type(body.message) ~= 'string' then return {action='block'} end body.message = (config.prefix or '') .. body.message request.body = host.json.encode(body) return {action='replace', value=request} end return plugin