當前位置: 首頁>>代碼示例>>Python>>正文


Python telegram.ReplyKeyboardRemove方法代碼示例

本文整理匯總了Python中telegram.ReplyKeyboardRemove方法的典型用法代碼示例。如果您正苦於以下問題:Python telegram.ReplyKeyboardRemove方法的具體用法?Python telegram.ReplyKeyboardRemove怎麽用?Python telegram.ReplyKeyboardRemove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在telegram的用法示例。


在下文中一共展示了telegram.ReplyKeyboardRemove方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: inevidenza

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def inevidenza(bot, update):
    """Defining function that prints 5 news from in evidenza"""

    news_to_string = ""
    for i, item in enumerate(utils.NEWS['univaq'][0:5]):
        news_to_string += (str(i + 1) + ' - <a href="{link}">{title}</a>\n\n').format(**item)

    news_to_string += ('<a href="http://www.univaq.it">'
                       'Vedi le altre notizie</a> e attiva le notifiche con /newson per '
                       'restare sempre aggiornato')

    bot.sendMessage(update.message.chat_id,
                    parse_mode='HTML', disable_web_page_preview=True, text=news_to_string,
                    reply_markup=telegram.ReplyKeyboardRemove())

    return ConversationHandler.END 
開發者ID:giacomocerquone,項目名稱:UnivaqBot,代碼行數:18,代碼來源:univaq.py

示例2: discab_news

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def discab_news(bot, update, section):
    """Defining function that prints 5 news from discab given section"""

    news_to_string = ""
    for i, item in enumerate(utils.NEWS[section]):
        news_to_string += (str(i + 1) + ' - <a href="{link}">{title}</a>\n\n').format(**item)

    news_to_string += ('<a href="http://discab.univaq.it/index.php?id=2004">'
                       'Vedi le altre notizie</a> e attiva le notifiche con /newson per '
                       'restare sempre aggiornato')

    bot.sendMessage(update.message.chat_id,
                    parse_mode='HTML', disable_web_page_preview=True, text=news_to_string,
                    reply_markup=telegram.ReplyKeyboardRemove())

    return ConversationHandler.END 
開發者ID:giacomocerquone,項目名稱:UnivaqBot,代碼行數:18,代碼來源:discab.py

示例3: send_to_developers

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def send_to_developers(bot, update):
    """Function to send feedback to developers"""

    feedback_user = (('<b>{}</b>\n\n <i>{} {}, {}</i>')
                     .format(update.message.text,
                             update.message.from_user.first_name,
                             update.message.from_user.last_name,
                             update.message.chat_id))

    for admin in os.environ['ADMIN'].split(' '):
        bot.sendMessage(admin, feedback_user, parse_mode='HTML')

    bot.sendMessage(update.message.chat_id, 'Grazie per la collaborazione, '
                                            'il messaggio è stato inviato agli sviluppatori.',
                    reply_markup=telegram.ReplyKeyboardRemove())

    return ConversationHandler.END 
開發者ID:giacomocerquone,項目名稱:UnivaqBot,代碼行數:19,代碼來源:feedback.py

示例4: paginate

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def paginate(bot, update, result):
        markup = ReplyKeyboardRemove()
        output = result.output
        time1 = result.time
        memory1 = result.memory
        message1 = result.message
        if time1 is not None:
            time1 = time1[0]
        if memory1 is not None:
            memory1 = memory1[0]
        if output is not None:
            output = output[0]
        else:
            output = ""
        if len(output) <= 2897:
            update.message.reply_text("Output:\n" + str(output) + "\n" + "Time: " + str(time1) + "\nMemory: " + str(
                memory1) + "\nMessage: " + str(message1), reply_markup=markup)
        else:
            with open("out.txt", "w") as text_file:
                text_file.write("Output:\n" + str(output) + "\n" + "Time: " + str(time1) + "\nMemory: " + str(
                    memory1) + "\nMessage: " + str(message1))
            bot.send_document(chat_id=update.message.chat_id, document=open('out.txt', 'rb'), reply_markup=markup)
            os.remove('out.txt')

    # FUNCTION TO CREATE XLSX FILES 
開發者ID:Gotham13121997,項目名稱:superCodingBot,代碼行數:27,代碼來源:utility.py

示例5: send_message

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def send_message(self, msg, chat_id=None, reply_markup=None):
        if not isinstance(msg, dict):
            msg = {'text': msg}
        if not msg['text']:
            return
        if len(msg['text']) > self.MAX_LENGTH_MESSAGE:
            msg['text'] = msg['text'][:self.MAX_LENGTH_MESSAGE - 3] + '...'

        msg['chat_id'] = chat_id or self.from_id

        msg['disable_web_page_preview'] = True
        if reply_markup:
            msg['reply_markup'] = reply_markup
        if 'reply_markup' not in msg:
            msg['reply_markup'] = telegram.ReplyKeyboardRemove()
        if reply_markup is False or getattr(self, 'chat_type', None) == 'channel':
            msg.pop('reply_markup', None)

        try:
            ret = self.sendMessage(parse_mode='Markdown', **msg)
        except Exception:
            self.logger.error('Exception send message = %s' % msg)
            ret = self.sendMessage(**msg)
        return ret 
開發者ID:aropan,項目名稱:clist,代碼行數:26,代碼來源:bot.py

示例6: destroy_app

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def destroy_app(self, bot, update, user_data):
        if user_data.get('job'):
            user_data.pop('job').schedule_removal()
        # end if
        if user_data.get('app'):
            app = user_data.pop('app')
            app.destroy()
            # remove output path
            #shutil.rmtree(app.output_path, ignore_errors=True)
        # end if
        update.message.reply_text(
            'Session closed',
            reply_markup=ReplyKeyboardRemove()
        )
        return ConversationHandler.END
    # end def 
開發者ID:dipu-bd,項目名稱:lightnovel-crawler,代碼行數:18,代碼來源:telegram.py

示例7: handle_delete_cache

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def handle_delete_cache(self, bot, update, user_data):
        app = user_data.get('app')
        user = update.message.from_user
        text = update.message.text
        if text.startswith('No'):
            if os.path.exists(app.output_path):
                shutil.rmtree(app.output_path, ignore_errors=True)
            os.makedirs(app.output_path, exist_ok=True)
            # end if
        # end if

        # Get chapter range
        update.message.reply_text(
            '%d volumes and %d chapters found.' % (
                len(app.crawler.volumes),
                len(app.crawler.chapters)
            ),
            reply_markup=ReplyKeyboardRemove()
        )
        return self.display_range_selection_help(bot, update)
    # end def 
開發者ID:dipu-bd,項目名稱:lightnovel-crawler,代碼行數:23,代碼來源:telegram.py

示例8: resend

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def resend(bot, update: Update, user, render):
    tasks.send_confirmation_mail.delay(user.pk)
    update.message.reply_text(text=render('confirmation_message_is_sent'), reply_markup=ReplyKeyboardRemove()) 
開發者ID:f213,項目名稱:selfmailbot,代碼行數:5,代碼來源:app.py

示例9: reset_email

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def reset_email(bot, update: Update, user, render):
    user.email = None
    user.is_confirmed = False
    user.save()

    update.message.reply_text(text=render('email_is_reset'), reply_markup=ReplyKeyboardRemove()) 
開發者ID:f213,項目名稱:selfmailbot,代碼行數:8,代碼來源:app.py

示例10: close

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def close(bot, update):
    """Defining Function for remove keyboard"""

    bot.sendMessage(update.message.chat_id,
                    'Ho chiuso le news!',
                    reply_markup=telegram.ReplyKeyboardRemove())

    return ConversationHandler.END 
開發者ID:giacomocerquone,項目名稱:UnivaqBot,代碼行數:10,代碼來源:news_commands.py

示例11: disim

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def disim(bot, update):
    """Defining the command to retrieve 5 news
    Now we store the last 10 news into the database,
    the comparison to send notifications is made between
    the last 5 pulled news from disim site and the news stored into the db.
    This decision was made to avoid repeated news, in fact, if some news(from first to fifth)
    is deleted the sixth(that now has become the fifth) news will be sent again even if it is
    already been sent in the past because it will appear in the pulled news and it
    is no more present into the database at the moment of the comparison.
    """

    news_to_string = ""
    for i, item in enumerate(utils.NEWS['disim'][0:5]):
        suffix = '...' if len(item['description']) > 75 else ''
        news_to_string += (str(i + 1) + ' - <a href="{link}">{title}</a>\n'
                           '\t<i>{description:.75}{}</i>\n\n').format(suffix, **item)

    news_to_string += ('<a href="http://www.disim.univaq.it/main/news.php?entrant=1">'
                       'Vedi le altre notizie</a> e attiva le notifiche con /newson per '
                       'restare sempre aggiornato')

    bot.sendMessage(update.message.chat_id,
                    parse_mode='HTML', disable_web_page_preview=True, text=news_to_string,
                    reply_markup=telegram.ReplyKeyboardRemove())

    return ConversationHandler.END 
開發者ID:giacomocerquone,項目名稱:UnivaqBot,代碼行數:28,代碼來源:disim.py

示例12: disimon

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def disimon(bot, update):
    """Defining the command to enable notification for disim"""

    if update.message.chat_id not in utils.USERS['disim']:
        utils.subscribe_user(update.message.chat_id, 'disim')
        bot.sendMessage(update.message.chat_id,
                        text='Notifiche Abilitate!',
                        reply_markup=telegram.ReplyKeyboardRemove())
    else:
        bot.sendMessage(update.message.chat_id,
                        text='Le notifiche sono già abilitate!',
                        reply_markup=telegram.ReplyKeyboardRemove())

    return ConversationHandler.END 
開發者ID:giacomocerquone,項目名稱:UnivaqBot,代碼行數:16,代碼來源:disim.py

示例13: disimoff

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def disimoff(bot, update):
    """Defining the command to disable notification for disim"""

    if update.message.chat_id in utils.USERS['disim']:
        utils.unsubscribe_user(update.message.chat_id, 'disim')
        bot.sendMessage(update.message.chat_id,
                        text='Notifiche Disattivate!',
                        reply_markup=telegram.ReplyKeyboardRemove())
    else:
        bot.sendMessage(update.message.chat_id,
                        text='Per disattivare le notifiche dovresti prima attivarle.',
                        reply_markup=telegram.ReplyKeyboardRemove())

    return ConversationHandler.END 
開發者ID:giacomocerquone,項目名稱:UnivaqBot,代碼行數:16,代碼來源:disim.py

示例14: univaqon

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def univaqon(bot, update):
    """Defining the command to enable notification for univaq"""

    if update.message.chat_id not in utils.USERS['univaq']:
        utils.subscribe_user(update.message.chat_id, 'univaq')
        bot.sendMessage(update.message.chat_id,
                        text='Notifiche Abilitate!',
                        reply_markup=telegram.ReplyKeyboardRemove())
    else:
        bot.sendMessage(update.message.chat_id,
                        text='Le notifiche sono già abilitate!',
                        reply_markup=telegram.ReplyKeyboardRemove())

    return ConversationHandler.END 
開發者ID:giacomocerquone,項目名稱:UnivaqBot,代碼行數:16,代碼來源:univaq.py

示例15: univaqoff

# 需要導入模塊: import telegram [as 別名]
# 或者: from telegram import ReplyKeyboardRemove [as 別名]
def univaqoff(bot, update):
    """Defining the command to disable notification for univaq"""

    if update.message.chat_id in utils.USERS['univaq']:
        utils.unsubscribe_user(update.message.chat_id, 'univaq')
        bot.sendMessage(update.message.chat_id,
                        text='Notifiche Disattivate!',
                        reply_markup=telegram.ReplyKeyboardRemove())

    else:
        bot.sendMessage(update.message.chat_id,
                        text='Per disattivare le notifiche dovresti prima attivarle.',
                        reply_markup=telegram.ReplyKeyboardRemove())

    return ConversationHandler.END 
開發者ID:giacomocerquone,項目名稱:UnivaqBot,代碼行數:17,代碼來源:univaq.py


注:本文中的telegram.ReplyKeyboardRemove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。