예제 #1
0
def fecharJogo(chat_id, u_id, message_id, date):
    l = c.getLanguage(chat_id)
    rpl = []
    if bds.checkAdm(chat_id, u_id):
        bds.setPreGame(chat_id, False)
        bds.setInGame(chat_id, True)
        lista = bds.getCats(chat_id)
        if ((len(lista) == 0) or (0 in lista)):
            categoria = randint(0, (len(l.palavras)-1))
        else:
            cat = randint(0, len(lista)-1)
            categoria = lista[cat]-1
        palavra = randint(1, (len(l.palavras[categoria])-1))
        palavra = l.palavras[categoria][palavra].decode('utf-8')
        categoria = l.palavras[categoria][0]
        mascara = bds.setCP(chat_id, categoria, palavra)
        vidas = bds.setVidas(chat_id)
        bds.shufflePlayers(chat_id, date)
        u_names = bds.getPlayers(chat_id)[1]
        message_ids = bds.getPlayers(chat_id)[2]
        ordem = ''
        for i in range(len(u_names)):
            ordem = ordem+u_names[i]+'\n'
        kb = c.makeKb(c.getKb(chat_id, 'main')[0], resize_keyboard = True, selective = True)
        rpl.append(c.toDict(chat_id, l.close_game_msg, replyMarkup = c.makeKbh(True)))
        rpl.append(c.toDict(chat_id, ordem, replyTo = message_ids[0], replyMarkup = kb))
        rpl.append(c.toDict(chat_id, l.categoria_msg+categoria))
        rpl.append(c.toDict(chat_id, l.palavra_msg+mascara))
        rpl.append(c.toDict(chat_id, l.vidas_msg+g.vidasEmoji(chat_id)))
        return rpl
    return [c.toDict(chat_id, l.cantdo_msg)]
예제 #2
0
def fecharJogo(chat_id, u_id, message_id, date):
    l = c.getLanguage(chat_id)
    rpl = []
    if bds.checkAdm(chat_id, u_id):
        bds.setPreGame(chat_id, False)
        bds.setInGame(chat_id, True)
        lista = bds.getCats(chat_id)
        if ((len(lista) == 0) or (0 in lista)):
            categoria = randint(0, (len(l.palavras)-1))
        else:
            cat = randint(0, len(lista)-1)
            categoria = lista[cat]-1
        palavra = randint(1, (len(l.palavras[categoria])-1))
        palavra = l.palavras[categoria][palavra].decode('utf-8')
        categoria = l.palavras[categoria][0]
        mascara = bds.setCP(chat_id, categoria, palavra)
        vidas = bds.setVidas(chat_id)
        bds.shufflePlayers(chat_id, date)
        u_names = bds.getPlayers(chat_id)[1]
        message_ids = bds.getPlayers(chat_id)[2]
        ordem = ''
        for i in range(len(u_names)):
            ordem = ordem+u_names[i]+'\n'
        kb = c.makeKb(c.getKb(chat_id, 'main')[0], resize_keyboard = True, selective = True)
        rpl.append(c.toDict(chat_id, l.close_game_msg, replyMarkup = c.makeKbh(True)))
        rpl.append(c.toDict(chat_id, ordem + '\n' + l.categoria_msg+categoria +
                                    '\n' + l.palavra_msg+mascara + '\n' +  
                                    l.vidas_msg+g.vidasEmoji(chat_id),
                                    replyTo = message_ids[0], replyMarkup = kb))
        """rpl.append(c.toDict(chat_id, l.categoria_msg+categoria))
        rpl.append(c.toDict(chat_id, l.palavra_msg+mascara))
        rpl.append(c.toDict(chat_id, l.vidas_msg+g.vidasEmoji(chat_id)))"""
        return rpl
    return [c.toDict(chat_id, l.cantdo_msg)]
예제 #3
0
def novojogo(chat_id, u_id, u_name, message_id):
    l = getLanguage(chat_id)
    rpl = []
    bds.setPreGame(chat_id, True, u_id = u_id, u_name = u_name, message_id = message_id)
    kb = getKb(chat_id, 'main')
    keyboard = makeKb(kb[0], resize_keyboard = True)
    rpl.append(toDict(chat_id, l.inicial_msg, replyMarkup = keyboard))
    keyboard = makeKb(kb[1], resize_keyboard = True, selective = True)
    rpl.append(toDict(chat_id, l.inicialMsg(u_name), replyTo = message_id, replyMarkup = keyboard))
    return rpl
예제 #4
0
def novojogo(chat_id, u_id, u_name, message_id):
    l = getLanguage(chat_id)
    rpl = []
    bds.setPreGame(chat_id,
                   True,
                   u_id=u_id,
                   u_name=u_name,
                   message_id=message_id)
    kb = getKb(chat_id, 'main')
    keyboard = makeKb(kb[0], resize_keyboard=True)
    rpl.append(toDict(chat_id, l.inicial_msg, replyMarkup=keyboard))
    keyboard = makeKb(kb[1], resize_keyboard=True, selective=True)
    rpl.append(
        toDict(chat_id,
               l.inicialMsg(u_name),
               replyTo=message_id,
               replyMarkup=keyboard))
    return rpl
예제 #5
0
def setPreGame(chat_id, status):
    bds.setPreGame(chat_id, status)