<commit_before>﻿module Console

open System
open Client
open Display

let processMessage (str:string) (state:Client.State) =
    let args = str.Split ' ' |> Array.toList

    match args with
    | "join"::channels ->
        channels
        |> List.fold Client.joinChannel state
    | "leave"::channels ->
        channels
        |> List.fold Client.leaveChannel state
    | "send"::channel::messages ->
        let msg = messages |> String.concat " "
        Client.sendMessage state channel msg
        state
    | "mods"::channel::_ ->
        let mods =
            state.mods
            |> List.filter (fun (chan,_) -> chan = channel)

        printTimeAndChannel channel
        cprintf ConsoleColor.DarkYellow "%d" mods.Length
        cprintf ConsoleColor.DarkMagenta " Moderators:%s" Environment.NewLine

        let printMod (_,name) =
            printTimeAndChannel channel
            cprintf ConsoleColor.DarkYellow "%s" name
            printfn ""

        mods |> List.iter printMod
        state
    | "channels"::_ ->
        let channels = state.channels

        printTime()
        cprintf ConsoleColor.DarkYellow "%d" channels.Length
        cprintf ConsoleColor.DarkMagenta " Channels:%s" Environment.NewLine

        let printChannel channel =
            printTime()
            cprintf ConsoleColor.DarkYellow "%s" channel
            printfn ""

        channels |> List.iter printChannel
        state
    | _ ->
        state<commit_msg>Add "leaveall" command<commit_after>﻿module Console

open System
open Client
open Display

let processMessage (str:string) (state:Client.State) =
    let args = str.Split ' ' |> Array.toList

    match args with
    | "join"::channels ->
        channels
        |> List.fold Client.joinChannel state
    | "leave"::channels ->
        channels
        |> List.fold Client.leaveChannel state
    | "send"::channel::messages ->
        let msg = messages |> String.concat " "
        Client.sendMessage state channel msg
        state
    | "mods"::channel::_ ->
        let mods =
            state.mods
            |> List.filter (fun (chan,_) -> chan = channel)

        printTimeAndChannel channel
        cprintf ConsoleColor.DarkYellow "%d" mods.Length
        cprintf ConsoleColor.DarkMagenta " Moderators:%s" Environment.NewLine

        let printMod (_,name) =
            printTimeAndChannel channel
            cprintf ConsoleColor.DarkYellow "%s" name
            printfn ""

        mods |> List.iter printMod
        state
    | "channels"::_ ->
        let channels = state.channels

        printTime()
        cprintf ConsoleColor.DarkYellow "%d" channels.Length
        cprintf ConsoleColor.DarkMagenta " Channels:%s" Environment.NewLine

        let printChannel channel =
            printTime()
            cprintf ConsoleColor.DarkYellow "%s" channel
            printfn ""

        channels |> List.iter printChannel
        state
    | "leaveall"::_ ->
        state.channels
        |> List.fold Client.leaveChannel state
    | _ ->
        state
{'fraction_non_alphanumeric': 0.0967741935483871, 'fraction_numerical': 0.0, 'mean_word_length': 2.0604229607250755, 'pattern_counts': {'":': 11, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5648559', 'n_tokens_mistral': 826, 'n_tokens_neox': 808, 'n_words': 204}