Skip to content

Commit bc599e9

Browse files
committed
Revise Readme.
1 parent 6cc34dc commit bc599e9

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,13 @@ This package makes it easy to send Telegram notification using [Telegram Bot API
2626

2727
## Installation
2828

29-
Before you can send notifications via Telegram, you must install the Guzzle HTTP library via Composer:
30-
31-
``` bash
32-
composer require guzzlehttp/guzzle
33-
```
34-
35-
Then, You can install the package via composer:
29+
You can install the package via composer:
3630

3731
``` bash
3832
composer require laravel-notification-channels/telegram
3933
```
4034

41-
You must now install the service provider:
35+
You must install the service provider:
4236

4337
```php
4438
// config/app.php
@@ -65,6 +59,7 @@ Then, configure your Telegram Bot API Token:
6559
You can now use the channel in your `via()` method inside the Notification class.
6660

6761
``` php
62+
use NotificationChannels\Telegram\TelegramChannel;
6863
use NotificationChannels\Telegram\TelegramMessage;
6964
use Illuminate\Notifications\Notification;
7065

@@ -82,7 +77,7 @@ class InvoicePaid extends Notification
8277
return TelegramMessage::create()
8378
->to($this->user->telegram_user_id) // Optional.
8479
->content("*HELLO!* \n One of your invoices has been paid!") // Markdown supported.
85-
->action('View Invoice', $url); // Inline Button
80+
->button('View Invoice', $url); // Inline Button
8681
}
8782
}
8883
```
@@ -91,7 +86,9 @@ Here's a screenshot preview of the above notification on Telegram Messenger:
9186

9287
![Laravel Telegram Notification Example](https://cloud.githubusercontent.com/assets/1915268/17590374/2e05e872-5ff7-11e6-992f-63d5f3df2db3.png)
9388

94-
You can either send the notification by providing with the chat id of the recipient to the `to($chatId)` method like shown in the above example or add a `routeNotificationForTelegram` method in your notifiable model:
89+
### Routing a message
90+
91+
You can either send the notification by providing with the chat id of the recipient to the `to($chatId)` method like shown in the above example or add a `routeNotificationForTelegram()` method in your notifiable model:
9592

9693
``` php
9794
...
@@ -111,7 +108,7 @@ public function routeNotificationForTelegram()
111108

112109
- `to($chatId)`: (integer) Recipient's chat id.
113110
- `content('')`: (string) Notification message, supports markdown. For more information on supported markdown styles, check out these [docs](https://telegram-bot-sdk.readme.io/docs/sendmessage#section-markdown-style).
114-
- `action($text, $url)`: (string) Adds an inline "Call to Action" button.
111+
- `button($text, $url)`: (string) Adds an inline "Call to Action" button. You can add as many as you want and they'll be placed 2 in a row.
115112
- `options([])`: (array) Allows you to add additional or override `sendMessage` payload (A Telegram Bot API method used to send message internally). For more information on supported parameters, check out these [docs](https://telegram-bot-sdk.readme.io/docs/sendmessage).
116113

117114
## Alternatives

0 commit comments

Comments
 (0)