Skip to content
This repository was archived by the owner on Jul 12, 2019. It is now read-only.

Commit

Permalink
Update message types to distingish between messages not directed at t…
Browse files Browse the repository at this point in the history
…he bot and those directed at the bot but with unknown format
  • Loading branch information
shalvah committed Feb 5, 2017
1 parent 2852fe1 commit 1f1b92a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ Right now, there are almost 1000 people on the Slack team, leading to a lot of c
Currently, hibot:
* Sends each member of the team an onboarding DM when they join, pointing them to all the info they need to get started.
* Handles requests by users to be added to the Gitlab projects
* Handles requests by users to be added to the conjure.io projects
* Handles requests by users to be added to the pivotaltracker projects

## What next?
We keep thinking of innovative ways to put this bot to work to help streamline things. If you think of any, please shoot a mail to shalvah.adebayo@gmail.com

## How can I get one for my team?
We realised the logic of this bot was quite tightly coupled to this particular Slack team, so we've forked this project to [hubot](https://github.com/Hng-X/hubot). hubot will have a web interface, so you can easily add it to your team and set up a responses and stuff without needing to write any code. If you want it to perform more tasks specific to your team, then you can just fork the project.
We realised the logic of this bot was quite tightly coupled to this particular Slack team, so we've forked this project to [hubot](https://github.com/Hng-X/dobot). hubot will have a web interface, so you can easily add it to your team and set up a responses and stuff without needing to write any code. If you want it to perform more tasks specific to your team, then you can just fork the project.

## Anything else?
Yeah. Just in case you didn't know, hibot is built on Laravel, the PHP framework. Cool, right?
Expand Down
6 changes: 5 additions & 1 deletion app/Slack/MessageParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function parse()
{
$text = $this->request["event"]["text"];
$parsed = array(
"type" => "unknown"
"type" => "not-directed"
);

$botUserId = Credential::where('team_id', $this->request['team_id'])
Expand Down Expand Up @@ -63,6 +63,10 @@ public function parse()
$parsed["project"] = strtolower($matches[1]);
} else $parsed["project"] = "getting-started";
return $parsed;
} else {
$parsed = array(
"type" => "unknown"
);
}
}
Log::info("Parsed: " . print_r($parsed, true));
Expand Down

0 comments on commit 1f1b92a

Please sign in to comment.