def start_message(message: Message): """ Start message. """ if not chat_in_database(db, message.chat.id): createNew(db, message.chat.id) telegramtools.answer(bot, logger, message, START_MESSAGE)
def addmembers(message: Message): chat_id = message.chat.id if not chat_in_database(db, chat_id): startMessage(message) return aliases = message.text.split()[1:] if len(aliases) < 1: telegramtools.answer(bot, logger, message, ADDMEMBER_ERORR) return noticelist = extend_notice_list(db, chat_id, aliases) telegramtools.answer(bot, logger, message, SUCCESS_ADDMEMBER % '\n'.join(noticelist).replace('@', ''))
def sendNextCleaningDay(message: Message): chat = get_chat(db, message.chat.id) building = int(chat['chosenbuilding']) if building is 0: telegramtools.answer(bot, logger, message, HAVE_NOT_BUILDING) return nextCleaning = timetools.get_next_cleaning_day(building) telegramtools.answer(bot, logger, message, NEXT_DAY % (tools.ordinal(building), tools.ordinal(nextCleaning.day), timetools.getMonthName(nextCleaning)), parse_mode='Markdown')
def sendSchedule(message: Message): url = "https://hotel.university.innopolis.ru/assets/images/schedule.png" telegramtools.answer(bot, logger, message, url)
def change_building(message: Message): telegramtools.answer(bot, logger, message, CHANGE_BUILDING_MESSAGE, reply_markup=telegramtools.generate_choose_day_button())