import telebot
from telebot import types

import timetable as table
import weather

token = 'your_token'
bot = telebot.TeleBot(token)


@bot.message_handler(commands=['functions'])
def functions_handler(message):
    bot.send_message(message.chat.id, '1 - Распсание \n'
                                      '2 - Погода \n')


@bot.message_handler(commands=['help'])
def show_info():
    pass


@bot.message_handler(commands=['start'])
def show_start_info():
    pass


@bot.message_handler(content_types=['text'])
def main_activity(message):
    try:
        if message.text == 'Погода':
            current_weather = bot.send_message(message.chat.id, 'Введите город')
            bot.register_next_step_handler(current_weather, weather.weather_handler)
        if message.text == 'Расписание':
            keyboard = types.ReplyKeyboardMarkup(resize_keyboard=True)
            keyboard.add('Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница')
            keyboard.one_time_keyboard = True
            timetable = bot.reply_to(message, 'Укажите день недели', reply_markup=keyboard)
            bot.register_next_step_handler(timetable, table.timetable_handler)
    except Exception as e:
        bot.send_message(message.chat.id, e.args)


if __name__ == '__main__':
    bot.polling(none_stop=True)
