diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-17 19:05:12 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-17 19:05:12 +0200 |
| commit | 6e2f2c80463e8d19c24edebbe85331f6b083cf06 (patch) | |
| tree | 4623d78c61651484b1dc7bc4abb882f1a35f7781 /responses.js | |
| parent | 7aa7a45e3f46fd1bc3a965c0c4a40bded288d7a8 (diff) | |
| download | discordbot-6e2f2c80463e8d19c24edebbe85331f6b083cf06.tar.gz discordbot-6e2f2c80463e8d19c24edebbe85331f6b083cf06.zip | |
have timeouts as env vars
Diffstat (limited to 'responses.js')
| -rw-r--r-- | responses.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/responses.js b/responses.js index 15e7ec7..9137af0 100644 --- a/responses.js +++ b/responses.js @@ -11,7 +11,8 @@ const Commando = require("discord.js-commando"), api = require("./api"); const PREVIEW = process.env.PREVIEW || true, - MATCH_HISTORY_LEN = parseInt(process.env.MATCH_HISTORY_LEN) || 3; + MATCH_HISTORY_LEN = parseInt(process.env.MATCH_HISTORY_LEN) || 3, + REACTION_TIMEOUT = parseInt(process.env.REACTION_TIMEOUT) || 60; // s const reactionsPipe = new Channel(); @@ -116,7 +117,7 @@ module.exports.onNewReaction = (reaction) => { // create an iterator that returns promises to await new reactions // the Promise result is the reaction name -function awaitReactions(message, emoji, timeout=60) { +function awaitReactions(message, emoji, timeout=REACTION_TIMEOUT) { const pipeOut = new Channel(); // stop listening after timeout setTimeout(() => pipeOut.close(), timeout*1000); |
