Skip to content

Commit

Permalink
Updating to && rng
Browse files Browse the repository at this point in the history
  • Loading branch information
O-Mutt committed Nov 20, 2021
1 parent 05c54cd commit 3a229ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hubot-plusplus-expanded-bonusly",
"version": "0.1.1",
"version": "0.1.2",
"description": "",
"main": "index.js",
"engines": {
Expand Down
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ module.exports = function (robot) {
const user = await userService.getUser(e.event.sender.slackId);
if (user.bonuslyDM === true || user.bonuslyDM === undefined) {
let dm = `We sent <@${e.event.recipient.slackId}> ${e.response.result.amount_with_currency} via Bonusly. You now have ${e.response.result.giver.giving_balance_with_currency} left.`;
if (!user.bonuslyAmount || e.event.amount === 1 || Helpers.rngBoolean()) {
dm += `\n Did you know you could change the amount you send per ${robot.name} Point? Just DM @${robot.name} \`change my bonusly points setting\`,`;
dm += '\n I will ask you about how many points you\'d like to send per `++` you respond with a number. Bingo Bango Bongo, you\'re all set.';
if ((!user.bonuslyAmount || e.event.amount === 1) && Helpers.rngBoolean()) {
dm += `\n\nDid you know you could change the amount you send per ${robot.name} Point?\n Just DM @${robot.name} \`change my bonusly points setting\`,`;
dm += '\nI will ask you about how many points you\'d like to send per `++` you respond with a number.\n :tada: Bingo Bango Bongo, you\'re all set.';
}
if (user.bonuslyDM === undefined || Helpers.rngBoolean()) {
dm += `\n Don't like these DMs about bonusly? Just DM @${robot.name} \`toggle dm about bonusly\` and we will turn off this DM.`;
if (user.bonuslyDM === undefined && Helpers.rngBoolean()) {
dm += `\n\nDon't like these DMs about bonusly?\nJust DM @${robot.name} \`toggle dm about bonusly\` and we will turn off this DM.`;
}
robot.messageRoom(e.event.sender.slackId, dm);
}
Expand Down

0 comments on commit 3a229ca

Please sign in to comment.