Bring back bots restricted on other platforms (#1141)

This commit is contained in:
Alexander Zinchuk 2021-06-11 03:15:49 +03:00
parent 4dba7dcb61
commit a53586f798

View File

@ -109,9 +109,19 @@ function buildApiChatRestrictions(peerEntity: GramJs.TypeUser | GramJs.TypeChat)
}
if (peerEntity instanceof GramJs.User) {
const restrictionReason = peerEntity.restricted
? buildApiChatRestrictionReason(peerEntity.restrictionReason)
: undefined;
if (restrictionReason === undefined) {
return {
isRestricted: false,
};
}
return {
isRestricted: peerEntity.restricted,
restrictionReason: buildApiChatRestrictionReason(peerEntity.restrictionReason),
restrictionReason,
};
} else if (peerEntity instanceof GramJs.Chat) {
return {