Ошибка при запуске .py из командной строки - “TypeError: can only concatenate str (not ”NoneType“) to str”

def notify_users(context):
    map_weekdays = {
        0: 'Понедельник',
        1: 'Вторник',
        2: 'Среда',
        3: 'Четверг',
        4: 'Пятница',
        5: 'Суббота',
        6: 'Воскресенье'
    }
    # Получение чат айди
    global database
    chat_ids = [int(chat_id.strip()) for chat_id in database.split(';') if chat_id.strip() != '']

    current_week_number = datetime.now().isocalendar()[1] % 2
    if current_week_number == 0:
        current_week_number = 2
    current_week_id = datetime.now().weekday()
    current_week_name = map_weekdays[current_week_id]

    schedule = get_schedule(filename=filename)
    for chat_id in chat_ids:
        text = ''
        if datetime.now().hour < 12:
            if current_week_name != 'Воскресенье':
                text += 'Сегодня будут следующие пары:\n'
                text += schedule[str(current_week_number)][map_weekdays[(current_week_id) % 7]]
        else:
            if current_week_name == 'Суббота':
                text += 'Завтра выходной!'
            else:
                if current_week_name == 'Воскресенье':
                    if current_week_number == 2:
                        current_week_number = 1
                    else:
                        current_week_number += 1
                else:
                    text += 'Завтра будут следующие пары:\n'
                    text += schedule[str(current_week_number)][map_weekdays[(current_week_id + 1) % 7]]
        try:
            if text:
                context.bot.send_message(chat_id=chat_id, text=text)
        except Exception as e:
            logger.error(f'(chat.id={chat_id}) failed - {e}')
...
...
...
if __name__ == '__main__':
    morning_time = time(3, 0, 0, 000000)
        evening_time = time(17, 0, 0, 000000)
        job = updater.job_queue
        job.run_once(notify_users, 1)
        # test_job.run_once(notify_users, 1)
        morning_job = updater.job_queue
        morning_job.run_daily(notify_users, morning_time)
        evening_job = updater.job_queue
        evening_job.run_daily(notify_users, evening_time)``

Ответы (0 шт):