import telebot, time
from random import choice
from telebot import types
import config
from data_base import User

bot = telebot.TeleBot(config.TOKEN)

db = User("data.db")

undone_time = lambda x: time.strftime("%H:%M:%S %d.%m.%Y", time.localtime(x))

bad_advice_list = db.copy_bad_advice()
choice_advice_list = db.copy_choice_advice()
rest_list = db.copy_rest()
helper_list = db.copy_helper()


@bot.message_handler(commands=['start'])
def menu(message):
    bot.send_message(message.chat.id,
                     text='Вот что я умею: ',
                     reply_markup=keyboard())


@bot.message_handler(content_types=['text'])
def message_handler(message):
    user_id = message.from_user.id
    stat = undone_time(message.date)
    if (not db.get_all_id(user_id)):
        db.add_id_to_db(user_id)