mesva.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:UnivaqBot 作者: giacomocerquone 项目源码 文件源码
def mesva_news(bot, update, section):
    """Defining function that prints 5 news from mesva 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://mesva.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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号