diff --git a/README.md b/README.md index 646c894..8e10e0b 100644 --- a/README.md +++ b/README.md @@ -27,4 +27,5 @@ Commandes - If a message contains `http://onlywat.ch`, the bot sends the same gif as above. - `!ow.timeleft` shows the remaining time before [Overwatch](https://playoverwatch.com/en-us/)'s launch. - `!dice 1d20+5` is a RPG tool to throw dice. You can use shortcuts like `!dice 20+3` (⇔ `!dice 1d20+3`) or `!dice 18` (⇔ `!dice 1d18+0`) -- `!nms.timeleft` shows the remaining time before [No Man's Sky](http://www.no-mans-sky.com/)'s launch. \ No newline at end of file +- `!nms.timeleft` shows the remaining time before [No Man's Sky](http://www.no-mans-sky.com/)'s launch. +- `!prepareyouranus` or `!beprepared` sends a link to [this image](http://memestorage.com/_nw/22/79844313.jpg). \ No newline at end of file diff --git a/bot.php b/bot.php index 71a5d2a..9599fb2 100755 --- a/bot.php +++ b/bot.php @@ -20,5 +20,6 @@ new MessageHandler\OverwatchTimeleft(), new MessageHandler\Propre(), new MessageHandler\NomanskyTimeleft(), + new MessageHandler\BePrepared(), ] ))->run(); diff --git a/composer.lock b/composer.lock index 1140a77..7baca0a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "6e2274ed7ac0ebc50a5eb9cc10d1580a", + "hash": "1f4e39b1caed26f8989c72b8a2c018f7", "content-hash": "0b15bf3fe6a23dcde01db1f2b1e60bc6", "packages": [ { @@ -322,16 +322,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.2.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "d094e337976dff9d8e2424e8485872194e768662" + "reference": "b1a96f6134f69cb41f8538d3a6491f4bb1dbab78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662", - "reference": "d094e337976dff9d8e2424e8485872194e768662", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b1a96f6134f69cb41f8538d3a6491f4bb1dbab78", + "reference": "b1a96f6134f69cb41f8538d3a6491f4bb1dbab78", "shasum": "" }, "require": { @@ -380,7 +380,7 @@ "rest", "web service" ], - "time": "2016-03-21 20:02:09" + "time": "2016-05-08 19:39:56" }, { "name": "guzzlehttp/promises", @@ -772,12 +772,12 @@ "source": { "type": "git", "url": "https://github.com/nrk/predis.git", - "reference": "01483234c73759452154373eb2c58694b174a512" + "reference": "75a8253ee465a59006aae6d3c32ab694043d557a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nrk/predis/zipball/01483234c73759452154373eb2c58694b174a512", - "reference": "01483234c73759452154373eb2c58694b174a512", + "url": "https://api.github.com/repos/nrk/predis/zipball/75a8253ee465a59006aae6d3c32ab694043d557a", + "reference": "75a8253ee465a59006aae6d3c32ab694043d557a", "shasum": "" }, "require": { @@ -812,14 +812,14 @@ "homepage": "http://clorophilla.net" } ], - "description": "Flexible and feature-complete PHP client library for Redis", + "description": "Flexible and feature-complete Redis client for PHP and HHVM", "homepage": "http://github.com/nrk/predis", "keywords": [ "nosql", "predis", "redis" ], - "time": "2016-05-19 09:43:39" + "time": "2016-05-23 10:09:43" }, { "name": "psr/cache", @@ -869,7 +869,7 @@ }, { "name": "psr/http-message", - "version": "1.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", diff --git a/src/Handler/BePrepared.php b/src/Handler/BePrepared.php new file mode 100644 index 0000000..74cea6e --- /dev/null +++ b/src/Handler/BePrepared.php @@ -0,0 +1,34 @@ + + */ +class BePrepared implements MessageHandler +{ + const URL = 'http://memestorage.com/_nw/22/79844313.jpg'; + + /** + * @param $message + * @return bool + */ + public function handle($message) + { + $message->channel->sendMessage(self::URL); + + return true; + } + + /** + * @param $message + * @return bool + */ + static public function isHandlingMessage($message) + { + return $message->content === '!prepareyouranus' || $message->content === '!beprepared'; + } +} \ No newline at end of file