def __user_info__(user_id): text = "Currently AFK: <b>{}</b>" if sql.is_afk(user_id): text = text.format("Yes") user = sql.check_afk_status(user_id) if user.reason: text += "\nReason: <code>{}</code>".format(html.escape( user.reason)) else: text = text.format("No") return text
def check_afk(update, context, user_id, fst_name, userc_id): if sql.is_afk(user_id): user = sql.check_afk_status(user_id) if not user.reason: if int(userc_id) == int(user_id): return res = "{} is afk".format(fst_name) update.effective_message.reply_text(res) else: if int(userc_id) == int(user_id): return res = "{} is afk.\nReason: {}".format(fst_name, user.reason) update.effective_message.reply_text(res)
def check_afk(update, context, user_id, fst_name, userc_id): afk_time = time_formatter(round(time.time() - TIME)) if sql.is_afk(user_id): user = sql.check_afk_status(user_id) if not user.reason: if int(userc_id) == int(user_id): return res = "{} is AFK! \nSince: {}".format(fst_name, afk_time) update.effective_message.reply_text(res) else: if int(userc_id) == int(user_id): return res = "{} is AFK!\nReason: {}\nSince: {}".format(fst_name, user.reason, afk_time) update.effective_message.reply_text(res)