示例#1
0
文件: afk.py 项目: MhdRezza/hitsuki
def no_longer_afk(update, context):
    user = update.effective_user  # type: Optional[User]

    if not user:  # ignore channels
        return

    res = sql.rm_afk(user.id)
    if res:
        send_message(
            update.effective_message,
            tl(update.effective_message, "{} is no longer AFK!").format(
                update.effective_user.first_name))
示例#2
0
def no_longer_afk(bot: Bot, update: Update):
    user = update.effective_user  # type: Optional[User]
    chat = update.effective_chat  # type: Optional[Chat]

    if not user:  # ignore channels
        return

    res = sql.rm_afk(user.id)
    if res:
        firstname = update.effective_user.first_name
        try:
            update.effective_message.reply_text(
                tld(chat.id, f"{firstname} is no longer AFK!"))
        except:
            return
示例#3
0
def no_longer_afk(bot: Bot, update: Update):
    user = update.effective_user
    chat = update.effective_chat
    message = update.effective_message

    if not user:  # ignore channels
        return

    res = sql.rm_afk(user.id)
    if res:
        if message.new_chat_members:  # dont say msg
            return
        firstname = update.effective_user.first_name
        try:
            message.reply_text(
                tld(chat.id, "user_no_longer_afk").format(firstname))
        except Exception:
            return