Skip to content

Commit

Permalink
Add lineIf to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MammutAlex committed Feb 22, 2024
1 parent 13a7acf commit 8fe9c0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class InvoicePaid extends Notification
// Markdown supported.
->content("Hello there!")
->line("Your invoice has been *PAID*")
->lineIf($notifiable->amount > 0, "Amount paid: {$notifiable->amount}")
->line("Thank you!")

// (Optional) Blade template for the content.
Expand Down Expand Up @@ -395,6 +396,7 @@ For more information on supported parameters, check out these [docs](https://cor

- `content(string $content, int $limit = null)`: Notification message, supports markdown. For more information on supported markdown styles, check out these [docs](https://core.telegram.org/bots/api#formatting-options).
- `line(string $content)`: Adds a message in a new line.
- `lineIf(bool $boolean, string $line)`: Adds a message in a new line if the given condition is true.
- `escapedLine(string $content)`: Adds a message in a new line while escaping special characters (For Markdown).
- `view(string $view, array $data = [], array $mergeData = [])`: (optional) Blade template name with Telegram supported HTML or Markdown syntax content if you wish to use a view file instead of the `content()` method.
- `chunk(int $limit = 4096)`: (optional) Message chars chunk size to send in parts (For long messages). Note: Chunked messages will be rate limited to one message per second to comply with rate limitation requirements from Telegram.
Expand Down
2 changes: 1 addition & 1 deletion src/TelegramMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function line(string $content): self
return $this;
}

public function lineIf($boolean, $line): self
public function lineIf(bool $boolean, string $line): self
{
if ($boolean) {
return $this->line($line);
Expand Down

0 comments on commit 8fe9c0b

Please sign in to comment.