defstudio / telegraph

Telegraph is a Laravel package for fluently interacting with Telegram Bots
MIT License
697 stars 118 forks source link

DTO\User loses is_bot=false property when call ...->toArray() method #416

Closed varemel closed 9 months ago

varemel commented 1 year ago

Hello,

When call DTO\User object toArray() method is_bot = false property is missing. array_filter() removes false values from array.

vendor/defstudio/telegraph/src/DTO/

public function toArray(): array
    {
        return array_filter([
            'id' => $this->id,
            'is_bot' => $this->isBot,
            'first_name' => $this->firstName,
            'last_name' => $this->lastName,
            'username' => $this->username,
            'language_code' => $this->languageCode,
        ]);
    }
Screenshot 2023-10-12 at 01 52 32 Screenshot 2023-10-12 at 01 57 28
fabio-ivona commented 1 year ago

Hi, thanks for pointing this out, we'll fix it in next release

fabio-ivona commented 9 months ago

fixed in #502