Beispiel #1
0
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)
Beispiel #2
0
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('@', ''))
Beispiel #3
0
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')
Beispiel #4
0
def sendSchedule(message: Message):
    url = "https://hotel.university.innopolis.ru/assets/images/schedule.png"
    telegramtools.answer(bot, logger, message, url)
Beispiel #5
0
def change_building(message: Message):
    telegramtools.answer(bot, logger, message, CHANGE_BUILDING_MESSAGE, reply_markup=telegramtools.generate_choose_day_button())