forked from WISVCH/hubot-plusplus-improved
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Log new user log * Fixing bug with user creation * bumping version and fixing minor bugs
- Loading branch information
Showing
8 changed files
with
75 additions
and
90 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
// Description: | ||
// Hubot scoreboard for hubot-plusplus-expanded. | ||
// | ||
// Commands: | ||
// @hubot score for @user - displays a snap shot of the user requested | ||
// @hubot top scores 10 - displays top 10 (or any number) scores of all time | ||
// @hubot bottom scores 5 - displays bottom 5 (or any number) scores of all time | ||
// @hubot top tokens 7 - displays top 7 (or any number) tokens of all time | ||
// @hubot bottom tokens 2 - displays top 2 (or any number) tokens of all time | ||
// @hubot top scores 10 - displays top 10 scores of all time | ||
// @hubot top scores 10 - displays top 10 scores of all time | ||
// | ||
// Author: | ||
// O'Mutt ([email protected]) | ||
|
||
const moment = require('moment'); | ||
const clark = require('clark'); | ||
const _ = require('lodash'); | ||
|
@@ -14,7 +29,6 @@ module.exports = function plusPlus(robot) { | |
robot.respond(regExpCreator.createTopBottomRegExp(), respondWithLeaderLoserBoard); | ||
robot.respond(regExpCreator.createTopBottomTokenRegExp(), respondWithLeaderLoserTokenBoard); | ||
robot.respond(regExpCreator.createTopPointGiversRegExp(), getTopPointSenders); | ||
robot.respond(regExpCreator.createBotDayRegExp(robot.name), respondWithUsersBotDay); | ||
|
||
async function respondWithScore(msg) { | ||
const { mentions } = msg.message; | ||
|
@@ -139,20 +153,4 @@ module.exports = function plusPlus(robot) { | |
|
||
return msg.send(message.join('\n')); | ||
} | ||
|
||
async function respondWithUsersBotDay(msg) { | ||
let userToLookup = msg.message.user.name; | ||
const isMy = msg.match[2].toLowerCase() !== 'my'; | ||
let messageName = 'Your'; | ||
robot.logger.debug(`respond with users bot day ${msg.match}`); | ||
if (isMy) { | ||
userToLookup = helpers.cleanName(msg.match[2]); | ||
} | ||
const user = await databaseService.getUser({ name: userToLookup }); | ||
if (isMy) { | ||
messageName = user.slackId ? `<@${user.slackId}>'s` : `${user.name}'s`; | ||
} | ||
const dateObj = new Date(user[`${robot.name}Day`]); | ||
msg.send(`${messageName} ${robot.name}day is ${moment(dateObj).format('MM-DD-yyyy')}`); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
// Description: | ||
// Hubot crypto wallet. This is used to manage the users wallet within the hubot-plusplus-expanded module | ||
// | ||
// Commands: | ||
// @hubot hot wallet - displays info for hubot's 'hot wallet' | ||
// @hubot level up my account - moves the user's account up 1 level (e.g. 1->2) to allow them to start receiving crypto | ||
// | ||
// Author: | ||
// O'Mutt ([email protected]) | ||
const _ = require('lodash'); | ||
const Conversation = require('hubot-conversation'); | ||
const tokenBuddy = require('token-buddy'); | ||
|
||
|
||
const helpers = require('./lib/helpers'); | ||
const regExpCreator = require('./lib/regexpCreator'); | ||
const DatabaseService = require('./lib/services/database'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters