Skip to content

Commit

Permalink
feds: fedadmins: handle deleted accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Dank-del authored and Astrako committed Jan 3, 2022
1 parent b175641 commit e1bb660
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions AstrakoBot/modules/feds.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ def fed_admin(update: Update, context: CallbackContext):
owner_name = owner.first_name + " " + owner.last_name
except:
owner_name = owner.first_name
except BaseException:
owner_name = owner.first_name or 'Deleted'
text += " • {}\n".format(mention_html(owner.id, owner_name))

members = sql.all_fed_members(fed_id)
Expand All @@ -549,6 +551,7 @@ def fed_admin(update: Update, context: CallbackContext):
text += "\n🔱 Admin:\n"
for x in members:
user = bot.get_chat(x)
name = user.first_name or 'Deleted'
text += " • {}\n".format(mention_html(user.id, user.first_name))

update.effective_message.reply_text(text, parse_mode=ParseMode.HTML)
Expand Down

0 comments on commit e1bb660

Please sign in to comment.