def __user_info__(user_id, chat_id): bio = html.escape(sql.get_user_bio(user_id) or "") me = html.escape(sql.get_user_me_info(user_id) or "") if bio and me: return tld(chat_id, "userinfo_what_i_and_other_say").format(me, bio) elif bio: return tld(chat_id, "userinfo_what_other_say").format(bio) elif me: return tld(chat_id, "userinfo_what_i_say").format(me) else: return ""
def __user_info__(user_id, chat_id): bio = html.escape(sql.get_user_bio(user_id) or "") me = html.escape(sql.get_user_me_info(user_id) or "") if bio and me: return "<b>About user:</b>\n{me}\n<b>What others say:</b>\n{bio}".format(me=me, bio=bio) elif bio: return "<b>What others say:</b>\n{bio}\n".format(me=me, bio=bio) elif me: return "<b>About user:</b>\n{me}""".format(me=me, bio=bio) else: return ""
def about_bio(bot: Bot, update: Update, args: List[str]): message = update.effective_message # type: Optional[Message] user_id = extract_user(message, args) if user_id: user = bot.get_chat(user_id) else: user = message.from_user info = sql.get_user_bio(user.id) if info: update.effective_message.reply_text("*{}*:\n{}".format(user.first_name, escape_markdown(info)), parse_mode=ParseMode.MARKDOWN) elif message.reply_to_message: username = user.first_name update.effective_message.reply_text("{} hasn't had a message set about themselves yet!".format(username)) else: update.effective_message.reply_text("You haven't had a bio set about yourself yet!")
def about_bio(bot: Bot, update: Update, args: List[str]): message = update.effective_message # type: Optional[Message] chat = update.effective_chat # type: Optional[Chat] user_id = extract_user(message, args) if user_id: user = bot.get_chat(user_id) else: user = message.from_user info = sql.get_user_bio(user.id) if info: update.effective_message.reply_text("*{}*:\n{}".format( user.first_name, escape_markdown(info)), parse_mode=ParseMode.MARKDOWN) elif message.reply_to_message: username = user.first_name update.effective_message.reply_text(tld(chat.id, 'userinfo_bio_none_they').format(username)) else: update.effective_message.reply_text(tld(chat.id, 'userinfo_bio_none_you'))