From dc251588e40360a050a1fee3d30092b1633ace89 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 9 Dec 2023 17:20:54 +0100 Subject: [PATCH] Small fix --- src/EventHandler/Wallpaper.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/EventHandler/Wallpaper.php b/src/EventHandler/Wallpaper.php index 9f956a807..9434196cc 100644 --- a/src/EventHandler/Wallpaper.php +++ b/src/EventHandler/Wallpaper.php @@ -52,8 +52,8 @@ final class Wallpaper implements JsonSerializable /** @var DocumentPhoto The actual wallpaper */ public readonly DocumentPhoto $media; - /** @var mixed Info on how to generate the wallpaper, according to [these instructions](https://core.telegram.org/api/wallpapers). */ - public readonly WallpaperSettings $settings; + /** Info on how to generate the wallpaper, according to [these instructions](https://core.telegram.org/api/wallpapers). */ + public readonly ?WallpaperSettings $settings; public function __construct( MTProto $API, @@ -67,7 +67,9 @@ final class Wallpaper implements JsonSerializable $this->dark = $rawWallpaper['dark']; $this->uniqueId = $rawWallpaper['slug']; $this->media = $API->wrapMedia($rawWallpaper['document']); - $this->settings = new WallpaperSettings($rawWallpaper['settings']); + $this->settings = isset($rawWallpaper['settings']) + ? new WallpaperSettings($rawWallpaper['settings']) + : null; } /** @internal */