コード例 #1
0
ファイル: afk.py プロジェクト: itachiuchiha302/allukabot
def no_longer_afk(bot: Bot, update: Update):
    user = update.effective_user  # type: Optional[User]
    chat = update.effective_chat  # type: Optional[Chat]
    message = update.effective_message  # type: Optional[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:
            options = [
                '{} is here!',
                '{} is back!',
                '{} is now in the chat!',
                '{} is awake!',
                '{} is back online!',
                '{} is finally here!',
                'Stop! Your Discussion\n {} Is Back.',
                'Welcome Back, {}',
                'Wait, What??🤨 \n {} Is Back!!',
                'Look Here Who Is Back! - {}',
                "I Can't Believe😵 \n {} Is Back!",
            ]
            chosen_option = random.choice(options)
            update.effective_message.reply_text(
                chosen_option.format(firstname))
        except:
            return
コード例 #2
0
ファイル: afk.py プロジェクト: toxic-dev0/Devil_queen
def no_longer_afk(bot: Bot, update: Update):

    user = update.effective_user

    if not user:
        return

    res = sql.rm_afk(user.id)
    if res:
        options = [
            '{} is here!', '{} is back!', '{} is now in the chat!',
            '{} is awake!', '{} is back online!', '{} is finally here!',
            'Welcome back!, {}', 'Where is {}?\nIn the chat!'
        ]
        chosen_option = random.choice(options)
        update.effective_message.reply_text(
            chosen_option.format(update.effective_user.first_name))
コード例 #3
0
ファイル: afk.py プロジェクト: sinonrobot/allukabot
def no_longer_afk(bot: Bot, update: Update):
    user = update.effective_user  # type: Optional[User]
    chat = update.effective_chat  # type: Optional[Chat]
    message = update.effective_message  # type: Optional[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:
            options = ['{} is back online!']
            chosen_option = random.choice(options)
            update.effective_message.reply_text(
                chosen_option.format(firstname))
        except:
            return
コード例 #4
0
ファイル: afk.py プロジェクト: toxic-dev0/Devil_queen
def __gdpr__(user_id):
    sql.rm_afk(user_id)