def __user_info__(user_id): is_blacklisted = sql.is_user_blacklisted(user_id) text = "Blacklisted: <b>{}</b>" if user_id in [777000, 1087968824]: return "" if user_id == dispatcher.bot.id: return "" if int(user_id) in DRAGONS + TIGERS + WOLVES: return "" if is_blacklisted: text = text.format("Yes") reason = sql.get_reason(user_id) if reason: text += f"\nReason: <code>{reason}</code>" else: text = text.format("No") return text
def bl_users(update: Update, context: CallbackContext): users = [] bot = context.bot for each_user in sql.BLACKLIST_USERS: user = bot.get_chat(each_user) reason = sql.get_reason(each_user) if reason: users.append( f"• {mention_html(user.id, html.escape(user.first_name))} :- {reason}" ) else: users.append( f"• {mention_html(user.id, html.escape(user.first_name))}") message = "<b>Blacklisted Users</b>\n" if not users: message += "Noone is being ignored as of yet." else: message += '\n'.join(users) update.effective_message.reply_text(message, parse_mode=ParseMode.HTML)