Skip to content

Commit

Permalink
Add a constraint in order to filter "slackbot" from userlist since it…
Browse files Browse the repository at this point in the history
…'s not considered as a bot by slack...
  • Loading branch information
elfaus committed Oct 4, 2016
1 parent a2949c8 commit b2a4a8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 0.7.4
Add a constraint into `slack:users:update` command which exclude `slackbot` from valid users. It appears that `slackbot` is not considered as a bot by Slack API.
We're waiting for a ticket issue response from Slack Team related to this bug.

# Version 0.7.3
Add a local channels clear which will delete no longer valid channels to the command `slack:channels:update` if there is an issue with the daemon.

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/SlackUsersUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function handle()

// iterate over each member, check if the user mail match with a seat account and update the relation table
foreach ($members as $m) {
if ($m['deleted'] == false && $m['is_bot'] == false &&
if ($m['id'] != 'USLACKBOT' && $m['deleted'] == false && $m['is_bot'] == false &&
!key_exists('api_app_id', $m['profile'])) {
$user = User::where('email', '=', $m['profile']['email'])->first();
if ($user != null) {
Expand All @@ -50,7 +50,7 @@ public function handle()
$slackUser->user_id = $user->id;
$slackUser->invited = true;
}

$slackUser->slack_id = $m['id'];
$slackUser->save();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Config/slackbot.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
* TODO: lazy coder, remember to edit this file before TAG ! DAMMIT !
*/
return [
'version' => '0.7.3'
'version' => '0.7.4'
];

0 comments on commit b2a4a8e

Please sign in to comment.