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 6cd5293
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions AstrakoBot/modules/feds.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ def fed_admin(update: Update, context: CallbackContext):
owner = bot.get_chat(info["owner"])
try:
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 +549,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 6cd5293

Please sign in to comment.