Skip to content

Commit

Permalink
add debugging mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottox committed May 5, 2020
1 parent 7634798 commit 16d818b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ Timeout to wait for a response in seconds

default: 60

### `debug`
Enables verbose output.

default: false

## Outputs

### `response_from`
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
13 changes: 12 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -34,7 +35,8 @@ const inputs = {
// channel: '##gottox-channel',
// channel_key: undefined,
// response_allow_from: "Gottox",
// response_timeout: 10
// response_timeout: 10,
// debug: true
//}


Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 16d818b

Please sign in to comment.