Commit ac020462ae9f45995e0764de81a4ddb61752ca3c
1 parent
f4e7983d3b
Exists in
master
Config to disable claim bonus/rebate
Showing 2 changed files with 12 additions and 1 deletions Side-by-side Diff
config.sample.json
... | ... | @@ -12,5 +12,6 @@ |
12 | 12 | "ascending_deposit": false, |
13 | 13 | "ascending_mutation": false, |
14 | 14 | "blacklist_help_for_origins": [], |
15 | - "blacklist_help_for_origin_transports": [] | |
15 | + "blacklist_help_for_origin_transports": [], | |
16 | + "disable_claim_bonus": false | |
16 | 17 | } |
17 | 18 | \ No newline at end of file |
lib/command-handler/claimbonus.js
1 | 1 | const coreEndpoint = '/rebate/claim-store'; |
2 | 2 | |
3 | +const config = require('komodo-sdk/config'); | |
4 | + | |
3 | 5 | const commandError = require('./error'); |
4 | 6 | const coreapi = require('../coreapi'); |
5 | 7 | |
... | ... | @@ -8,6 +10,14 @@ function help(keyword) { |
8 | 10 | } |
9 | 11 | |
10 | 12 | function execute(tokens, params, cb) { |
13 | + if (config.disable_claim_bonus || config.disable_claim_rebate) { | |
14 | + const responseParams = { | |
15 | + body: 'Maaf permintaan anda tidak dapat dilakukan', | |
16 | + } | |
17 | + | |
18 | + cb(null, null, responseParams); | |
19 | + return; | |
20 | + } | |
11 | 21 | |
12 | 22 | if (!tokens || tokens.length < 2) { |
13 | 23 | const responseParams = { |