Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions hydrogram/parser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
def add_surrogates(text):
# Replace each SMP code point with a surrogate pair
return SMP_RE.sub(
lambda match: # Split SMP in two surrogates
"".join(chr(i) for i in unpack("<HH", match.group().encode("utf-16le"))),
lambda match: ( # Split SMP in two surrogates
"".join(chr(i) for i in unpack("<HH", match.group().encode("utf-16le")))
),
text,
)

Expand Down
4 changes: 3 additions & 1 deletion hydrogram/types/user_and_chats/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ def _parse_channel_chat(client, channel: raw.types.Channel) -> Chat:
if isinstance(channel, raw.types.ChannelForbidden):
return Chat(
id=peer_id,
type=enums.ChatType.SUPERGROUP if getattr(channel, 'megagroup', False) else enums.ChatType.CHANNEL,
type=enums.ChatType.SUPERGROUP
if getattr(channel, "megagroup", False)
else enums.ChatType.CHANNEL,
title=channel.title,
client=client,
)
Expand Down