Skip to content

Commit

Permalink
Some fix for get_last_dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan committed Apr 14, 2024
1 parent 34bf8ba commit 9ab9270
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ async def fetch_recent_chats(limit):
number = ""
type_of_entity = ""
if chat.is_user:
number = chat.entity.phone
number = chat.entity.phone or chat.entity.username
type_of_entity = "user"
if chat.is_channel:
number = chat.entity.username or chat.entity.id
number = chat.entity.username
type_of_entity = "channel"
if chat.is_group:
number = chat.entity.id
type_of_entity = "group"
chat_names[chat.id] = {

if number == None:
number = chat.entity.id
chat_names[str(chat.id)] = {
"number": number,
"title": chat.name or chat.title,
"type_of_entity": type_of_entity,
Expand Down

0 comments on commit 9ab9270

Please sign in to comment.