From 67230b8ed26f14cd3818f18328d953c519cd768b Mon Sep 17 00:00:00 2001 From: Badiboy Date: Sun, 2 Jun 2024 21:26:21 +0300 Subject: [PATCH] Fix MessageEntity.user if None --- telebot/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/types.py b/telebot/types.py index 3358965b5..6ec9d8d4d 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -1665,7 +1665,7 @@ def to_dict(self): "offset": self.offset, "length": self.length, "url": self.url, - "user": self.user.to_dict(), + "user": self.user.to_dict() if self.user else None, "language": self.language, "custom_emoji_id": self.custom_emoji_id}