diff --git a/README.md b/README.md index 0933469..644cd82 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,11 @@ Timeout to wait for a response in seconds default: 60 +### `debug` +Enables verbose output. + +default: false + ## Outputs ### `response_from` diff --git a/action.yml b/action.yml index 4b27cf0..b93a523 100644 --- a/action.yml +++ b/action.yml @@ -41,6 +41,10 @@ inputs: description: 'Timeout to wait for a response in seconds' default: 60 required: false + debug: + description: 'Enables verbose output.' + default: false + required: false outputs: response_from: description: 'nickname of the responding user' diff --git a/app.js b/app.js index c990a8f..5f25d02 100644 --- a/app.js +++ b/app.js @@ -21,6 +21,7 @@ const inputs = { channel_key: core.getInput('channel_key'), response_allow_from: core.getInput('response_allow_from'), response_timeout: core.getInput('response_timeout'), + debug: core.getInput('debug'), } //const inputs = { @@ -34,7 +35,8 @@ const inputs = { // channel: '##gottox-channel', // channel_key: undefined, // response_allow_from: "Gottox", -// response_timeout: 10 +// response_timeout: 10, +// debug: true //} @@ -100,6 +102,15 @@ function handle_response() { }) } +if (inputs.debug) { + client.on('debug', (ev) => { + console.log('#', ev) + }); + client.on('raw', (ev) => { + console.log(ev.from_server ? '<' : '>', ev.line.trim()); + }); +} + client.on('registered', () => { const messages = eol.split(inputs.message); if (inputs.notice) {