def Template(haveblitz, have40lines, haveleague, havestats, havebadges):
    rank = ""
    stats = ""
    blitz = ""
    _40Lines = ""
    badges = ""
    if not haveblitz and not have40lines and not haveleague and not havestats:
        return "没有查找到关于 {username} 的数据，请手动前往 https://ch.tetr.io/u/{_id} 进行查看"
    if haveleague:
        rank = "{rank} 段用户 {username} {rating} TR {ranking}，段位分 {glicko}±{rd}，最近 10 场局数的数据：\n"
        stats = """L'PM:  {lpm} ( {pps} pps )
APM:  {apm} ( x{apm_multi} )
ADPM: {adpm} ( x{adpm_multi} ) ( {vs}vs )
"""
    else:
        rank = "Rank: No records or less than 10 games were played\n"
        if havestats:
            stats = """L'PM:  {lpm} ( {pps} pps )
APM:  {apm} ( x{apm_multi} )
ADPM: {adpm} ( x{adpm_multi} ) ( {vs}vs )
"""
    if haveblitz:
        blitz = "Blitz: {bestblitz_score} (https://tetr.io/#r:{replayid_blitz}) {blitz_ranking} \n"
    else:
        blitz = "Blitz: No records in this stream\n"
    if have40lines:
        _40Lines = "40L: {best40lines_time}s (https://tetr.io/#r:{replayid_40lines}) {_40L_ranking}\n"
    else:
        _40Lines = "40L: No records in this stream\n"
    if havebadges:
        badges = "Badge: \n{badge}\n"
    return rank + stats + blitz + _40Lines + badges + "更多信息请前往 https://ch.tetr.io/u/{_id}"

def Template(haveblitz, have40lines, haveleague, havestats, havebadges):
    rank = ""
    stats = ""
    blitz = ""
    _40Lines = ""
    badges = ""
    if not haveblitz and not have40lines and not haveleague and not havestats:
        return "没有查找到关于 {username} 的数据，请手动前往 https://ch.tetr.io/u/{_id} 进行查看"
    if haveleague:
        rank = "{rank} 段用户 {username} {rating} TR {ranking}，段位分 {glicko}±{rd}，最近 10 场局数的数据：\n"
        stats = """L'PM:  {lpm} ( {pps} pps )
APM:  {apm} ( x{apm_multi} )
ADPM: {adpm} ( x{adpm_multi} ) ( {vs}vs )
"""
    else:
        rank = "Rank: No records or less than 10 games were played\n"
        if havestats:
            stats = """L'PM:  {lpm} ( {pps} pps )
APM:  {apm} ( x{apm_multi} )
ADPM: {adpm} ( x{adpm_multi} ) ( {vs}vs )
"""
    if haveblitz:
        blitz = "Blitz: {bestblitz_score} (https://tetr.io/#r:{replayid_blitz}) {blitz_ranking} \n"
    else:
        blitz = "Blitz: No records in this stream\n"
    if have40lines:
        _40Lines = "40L: {best40lines_time}s (https://tetr.io/#r:{replayid_40lines}) {_40L_ranking}\n"
    else:
        _40Lines = "40L: No records in this stream\n"
    if havebadges:
        badges = "Badge: \n{badge}\n"
    return rank + stats + blitz + _40Lines + badges + "更多信息请前往 https://ch.tetr.io/u/{_id}"

L'PM:  {lpm} ( {pps} pps ) APM:  {apm} ( x{apm_multi} ) ADPM: {adpm} ( x{adpm_multi} ) ( {vs}vs ) L'PM:  {lpm} ( {pps} pps ) APM:  {apm} ( x{apm_multi} ) ADPM: {adpm} ( x{adpm_multi} ) ( {vs}vs ) #r:{replayid_blitz}) {blitz_ranking} \n" #r:{replayid_40lines}) {_40L_ranking}\n"