Пример #1
0
def arriscarPalavra2(chat_id, u_id, u_name, message_id, text):
    l = c.getLanguage(chat_id)
    bds.setArriscarBlock(chat_id, False)
    rpl = []
    palavra = bds.getPalavra(chat_id)
    if bds.checkPalavra(chat_id, u_id, text): #Jogador acertou o chute e venceu. O jogo acaba.
        keyboard = c.makeKb(c.getKb(chat_id, 'main')[0], resize_keyboard = True)
        rpl.append(c.toDict(chat_id, l.venceu(u_name) + '\n' + l.googleMsg(palavra), replyMarkup = keyboard))
        #rpl.append(c.toDict(chat_id, l.googleMsg(palavra)))
        return rpl
    else: #Jogador errou o chute
        rm = bds.rmPlayer(chat_id, u_id, message_id)
        if rm == True: #Jogador não era Adm, nada acontece.
            rpl.append(c.toDict(chat_id, l.perdeu(u_name), replyTo = message_id, replyMarkup = c.makeKbh(True, selective = True)))
            rpl.append(nextRound(chat_id))
            return rpl
        elif rm == 'setAdm': #Jogador era Adm e o Adm será passado para outro
            adm = bds.getAdm(chat_id)
            rpl.append(c.toDict(chat_id, l.perdeu(u_name) + '\n' + l.novoAdmMsg(adm[1]), replyTo = message_id, replyMarkup = c.makeKbh(True, selective = True)))
            #rpl.append(c.toDict(chat_id, l.novoAdmMsg(adm[1])))
            rpl.append(nextRound(chat_id))
            return rpl
        else: #O jogo acaba
            keyboard = c.makeKb(c.getKb(chat_id, 'main')[0], resize_keyboard = True)
            return [c.toDict(chat_id, l.perdeu(u_name)+'\n'+ l.gameover_msg, replyMarkup = keyboard)]
Пример #2
0
def sair(chat_id, u_id, u_name, message_id):
    aux = bds.rmPlayer(chat_id, u_id, message_id)
    l = c.getLanguage(chat_id)
    if aux == False:
        kb = c.makeKb(c.getKb(chat_id, 'main')[0], resize_keyboard = True)
        return [c.toDict(chat_id, l.sem_jogador_msg, replyMarkup = kb)]
    elif aux == 'setAdm':
        rpl = []
        pl = bds.getPlayers(chat_id)
        kb = c.makeKb(c.getKb(chat_id, 'main', u_id = u_id)[0], selective = True, resize_keyboard = True)
        rpl.append(c.toDict(chat_id, l.playerQuitMsg(u_name), replyTo = message_id, replyMarkup = kb))
        kb = c.makeKb(c.getKb(chat_id,'main')[1], resize_keyboard = True, selective = True)
        rpl.append(c.toDict(chat_id, l.novoAdmMsg(pl[1][0]), replyTo = pl[2][0], replyMarkup = kb))
        return rpl
    elif aux == True:
        kb = c.makeKb(c.getKb(chat_id,'main',u_id = u_id)[0], selective = True, resize_keyboard = True)
        return [c.toDict(chat_id, l.playerQuitMsg(u_name), replyTo = message_id, replyMarkup = kb)]
    elif aux == 'semPlayer':
        return [c.toDict(chat_id, l.is_out_msg)]
Пример #3
0
def arriscarPalavra2(chat_id, u_id, u_name, message_id, text):
    l = c.getLanguage(chat_id)
    bds.setArriscarBlock(chat_id, False)
    if bds.checkPalavra(chat_id, u_id, text):
        keyboard = c.makeKb(c.getKb(chat_id, 'main')[0], resize_keyboard = True)
        return [c.toDict(chat_id, l.venceu(u_name), replyMarkup = keyboard)]
    else:
        rm = bds.rmPlayer(chat_id, u_id, message_id)
        if rm == True:
            rpl = []
            rpl.append(c.toDict(chat_id, l.perdeu(u_name), replyTo = message_id, replyMarkup = c.makeKbh(True, selective = True)))
            rpl.append(nextRound(chat_id))
            return rpl
        elif rm == 'setAdm':
            rpl = []
            adm = bds.getAdm(chat_id)
            rpl.append(c.toDict(chat_id, l.perdeu(u_name), replyTo = message_id, replyMarkup = c.makeKbh(True, selective = True)))
            rpl.append(c.toDict(chat_id, l.novoAdmMsg(adm[1])))
            rpl.append(nextRound(chat_id))
            return rpl
        else:
            keyboard = c.makeKb(c.getKb(chat_id, 'main')[0], resize_keyboard = True)
            return [c.toDict(chat_id, l.perdeu(u_name)+'\n'+ l.gameover_msg, replyMarkup = keyboard)]
Пример #4
0
def rmPlayer(chat_id, rd):
    return bds.rmPlayer(chat_id, rd)