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)
评论列表
文章目录