def __init__(self, loop, active_users, def_send_message):
     self.__question_data = get_data_viktorina()
     self.__loop = loop
     self.__condition = 0
     self.active_users = active_users
     self.__active_question = ''
     self.__active_ansver = ''
     self._set_active_data()
     self._send_message = def_send_message
     self.__message_winer = 'Вы первым указали правильный ответ!\nПоздравляю!'
     self.__message_all = 'Пользователь @{} первым указал правильный ответ. Ответ {}.'
     self.__time_break = 30.0  # in second
     self._set_time_finish()
import asyncio
from aiotg import TgBot
from get_data_viktorina import get_data as get_data_viktorina
from get_question import Question_loop

# Debug mode
# PYTHONASYNCIODEBUG = 1

API = '89885175:AAEFAgCwgS-ITZ6uZo0rqOeRSofydT4bzrQ'
NUM_HANDLERS = 5

data_questions = get_data_viktorina()
bot = TgBot(API)
sem = asyncio.Semaphore(NUM_HANDLERS)
loop = asyncio.get_event_loop()

active_users = {}


@asyncio.coroutine
def send_message(chat_id, text, bot=bot):
    with (yield from sem):
        yield from bot._send_message(chat_id=chat_id, text=text, disable_web_page_preview='true')

question_loop = Question_loop(loop, active_users, send_message)


@bot.command(r"/start")
def start(message, match):
    if not message.is_group():
        print('Приєднався ',message.sender)