Skip to content

Commit

Permalink
Add rewards_list
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksei Lebedev committed Jun 12, 2020
1 parent 1bb6766 commit 031136e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"welcome_string": "Hi! 😊 I'm a bounty bot. And this is a stub. Are you ready for the awesome bounty campaign with automatic payout? Type **/help** to see bounty rules.",

/** Bounty rules. Shown by /help command. You can use template literals like ${config.twitter_follow[0]} and ${config.twitter_follow_list} **/
"help_message": "Get the reward right now!\n\nThe campaign rules:\n- Follow account ${config.twitter_follow[0]} on Twitter\n- Do something else\n- Send me the name (like *@adamant_im*) or the link to your Twitter profile to verify\n\n \nGo!",
"help_message": "Get the **${config.rewards_list}** reward right now!\n\nThe campaign rules:\n- Follow account ${config.twitter_follow[0]} on Twitter\n- Do something else\n- Send me the name (like @adamant_im) or the link to your Twitter profile to verify\n\n \nGo!",

/** Bot's name for notifications **/
"bot_name": "Lovely Bounty Bot",
Expand Down
7 changes: 7 additions & 0 deletions modules/configReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ try {
// exit(`Bot's ${address} config is wrong. To run Twitter campaign, set Twitter API credentials (twitter_api). Cannot start Bot.`);
}

// Create reward list
config.rewards_list = config.rewards
.map(t => {
return `${t.amount} ${t.currency}`;
})
.join(' + ');

// Process help_message as a template literal
config.twitter_follow_list = config.twitter_follow.join(', ');
config.twitter_retweet_w_comment_list = config.twitter_retweet_w_comment.join(', ');
Expand Down

0 comments on commit 031136e

Please sign in to comment.