From f664c17e903b2100f9297043287b1a712ebdc34b Mon Sep 17 00:00:00 2001 From: Ivan Torgov Date: Sat, 28 Mar 2020 13:52:18 +0300 Subject: [PATCH] Working on the readme file. --- README.md | 34 +++++++++++++++++-- tests/Feature/ExampleTest.php | 21 ------------ .../SendDeploymentNotificationTest.php | 22 ++++++++++++ ...iTest.php => IrazasyedTelegramBotTest.php} | 2 +- 4 files changed, 55 insertions(+), 24 deletions(-) delete mode 100644 tests/Feature/ExampleTest.php create mode 100644 tests/Feature/SendDeploymentNotificationTest.php rename tests/Unit/Integrations/Telegram/{IrazasyedTelegramBotApiTest.php => IrazasyedTelegramBotTest.php} (97%) diff --git a/README.md b/README.md index ddd8ccc..9b9f503 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -

Laravel Forge Telegram Bot

+# Laravel Forge Telegram Bot ## About -It's unofficial Laravel Forge chat bot for Telegram messenger. +[@LaravelForgeBot](https://t.me/LaravelForgeBot) is unofficial Laravel Forge chat bot for Telegram messenger. It helps you manage your servers in such operations as: @@ -18,3 +18,33 @@ It's really helpful when you don't want to enable "Quick deploy" feature for you Other awesome feature is sending deployment notifications from Laravel Forge to you or any other chat. Using this abilyty only one member of your team will manage servers in his private chat with the bot, but all members will recieve deployment notifications in your team chat. +## How to use + +List of available commands: + +* /addtoken +* /deletetoken +* /menu +* /showchatid + +You always can get an actual list of commands by using /help command. + +### /addtoken + +Use this command to add your [Laravel Forge API token](https://forge.laravel.com/user/profile#/api). +Note that you can add multiple tokens, so you can manage different Laravel Forge accounts from one place. +This command will trigger automaticaly after /start command. + +### /deletetoken + +If you want you can delete added token from the bot by using this command. + +### /menu + +This command creates a new menu for managing servers. + +### /showchatid + +Use this command to get an ID of any chat. +It will be helpful when you'll configure receiving deployment notifications to other chat. +Please note that if you have more than one bots in your target chat then you have to write bot's username after the command without space (/showchatid@LaravelForgeBot). diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index cdb5111..0000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,21 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -} diff --git a/tests/Feature/SendDeploymentNotificationTest.php b/tests/Feature/SendDeploymentNotificationTest.php new file mode 100644 index 0000000..1c5d7eb --- /dev/null +++ b/tests/Feature/SendDeploymentNotificationTest.php @@ -0,0 +1,22 @@ +post(route('integrations.forge.webhook', ['hash' => '111'])); + + $response->assertStatus(404); + } +} diff --git a/tests/Unit/Integrations/Telegram/IrazasyedTelegramBotApiTest.php b/tests/Unit/Integrations/Telegram/IrazasyedTelegramBotTest.php similarity index 97% rename from tests/Unit/Integrations/Telegram/IrazasyedTelegramBotApiTest.php rename to tests/Unit/Integrations/Telegram/IrazasyedTelegramBotTest.php index e447c9e..9bf527e 100644 --- a/tests/Unit/Integrations/Telegram/IrazasyedTelegramBotApiTest.php +++ b/tests/Unit/Integrations/Telegram/IrazasyedTelegramBotTest.php @@ -8,7 +8,7 @@ use Illuminate\Support\Facades\Http; use Tests\TestCase; -class IrazasyedTelegramBotApiTest extends TestCase +class IrazasyedTelegramBotTest extends TestCase { private function rawRequest(string $methodName, $data = []): Response {