diff --git a/Plugin.php b/Plugin.php index 55955ca..4425392 100644 --- a/Plugin.php +++ b/Plugin.php @@ -22,18 +22,28 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi // Use autoloader for Composer's packages that shipped with the plugin require(__DIR__ . '/vendor/autoload.php'); } - + /** + * Initializer + * @return boolean + */ public function initialized() { return true; } - + /** + * This creates the listener that listens for new + * threads to send out slack notifications + */ public function run() { $dispatcher = EventDispatcher::getInstance(); $dispatcher->attachListener(Events::THREAD_CREATE, $this, 'sendSlackNotification'); } - + /** + * Sends notification to slack. + * Sends the date with the username as well + * @return boolean + */ public function sendSlackNotification(&$args) { $settings = [ @@ -46,6 +56,8 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi $client->send(date('Y-m-d H:i:s') . ' - You have a new user waiting for a response. Username: ' . $args['thread']->userName); + + return true; } /** diff --git a/package.json b/package.json index 9b5a11d..88c544a 100644 --- a/package.json +++ b/package.json @@ -2,15 +2,33 @@ "version": "1.0.0", "devDependencies": { "event-stream": "~3.1.7", - "gulp": "~3.8.10", + "gulp": "^3.9.1", "gulp-chmod": "~1.2.0", - "gulp-composer": "^0.4.0", + "gulp-composer": "*", "gulp-gzip": "~0.0.8", "gulp-rename": "~1.2.0", "gulp-tar": "~1.3.1", - "gulp-zip": "~2.0.2", - "gulp-composer":"*", - "gulp-util": "*" - - } + "gulp-util": "*", + "gulp-zip": "~2.0.2" + }, + "name": "mibew_slack", + "description": "Provides Slack notifications when initiate a chat", + "main": "gulpfile.js", + "dependencies": { + "gulp": "^3.9.1", + "graceful-fs": "^4.1.11" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/dmcdaniel12/mibew_slack.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/dmcdaniel12/mibew_slack/issues" + }, + "homepage": "https://github.com/dmcdaniel12/mibew_slack#readme" }