Skip to content

Commit cdbb367

Browse files
committed
https://core.telegram.org/bots/api
last_name is Optional, and may be absent. The error suppression operator will skip the warning anyway.
1 parent 644ede1 commit cdbb367

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Telegram.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1946,8 +1946,11 @@ public function LastName()
19461946
if ($type == self::EDITED_MESSAGE) {
19471947
return @$this->data['edited_message']['from']['last_name'];
19481948
}
1949+
if ($type == self::MESSAGE) {
1950+
return @$this->data['message']['from']['last_name'];
1951+
}
19491952

1950-
return @$this->data['message']['from']['last_name'];
1953+
return '';
19511954
}
19521955

19531956
/// Get the username of the user

0 commit comments

Comments
 (0)