FeedbackBot.py 文件源码

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

项目:TelegramBots 作者: d-qoi 项目源码 文件源码
def alertAdmins(bot, username):
    admins = []
    logger.debug('alerting admins:')
    for group in MDB.groups.find():
        logger.debug("Admins in group %s: %s" %(group['title'], group['admins']))
        admins += group['admins']
    admins = set(admins)
    for admin in admins:
        try:
            bot.send_message(chat_id=admin,
                            text="%s is sending feedback, send /cancel to select and respond to them." % username)
        except TelegramError as te:
            logger.debug("Not all admins are interacting with the bot.")
            logger.debug("Error in alert Admins: %s" % te)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号