Skip to content

Commit

Permalink
Added limits in embed structures in discord notifications messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mho22 committed Aug 30, 2024
1 parent f6ef42a commit 9411082
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Notifications/Channels/Discord/DiscordMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public function fields(array $fields, bool $inline = true): self
{
foreach ($fields as $label => $value) {
$this->fields[] = [
'name' => Str::limit( $label, 250 ),
'value' => Str::limi( $value, 1000 ),
'name' => Str::limit($label, 250),
'value' => Str::limi($value, 1000),
'inline' => $inline,
];
}
Expand All @@ -119,14 +119,14 @@ public function toArray(): array
'avatar_url' => $this->avatarUrl,
'embeds' => [
[
'title' => Str::limit( $this->title, 250 ),
'title' => Str::limit($this->title, 250),
'url' => $this->url,
'type' => 'rich',
'description' => Str::limit( $this->description, 4000 ),
'fields' => array_slice( $this->fields, 0, 25 ),
'description' => Str::limit($this->description, 4000),
'fields' => array_slice($this->fields, 0, 25),
'color' => hexdec((string) $this->color),
'footer' => [
'text' => $this->footer ? Str::limit( $this->footer, 2000 ): '',
'text' => $this->footer ? Str::limit($this->footer, 2000) : '',
],
'timestamp' => $this->timestamp ?? now(),
],
Expand Down

0 comments on commit 9411082

Please sign in to comment.