<commit_before>![Mouse](./vendor/mouse.jpg)

A scriptable, configuration powered IRC bot that can handle as many connnections as you want.

## Table of Contents

1. [Installing](#installing)
    1. [Building from source](#building-from-source)
    2. [Downloading a binary](#downloading-a-binary)
2. [Configuring](#configuring)
    1. [Configuring with TOML](#configuring-with-toml)
    2. [Configuring with JSON](#configuring-with-json)
    3. [Configuring with HCL](#configuring-with-hcl)
    4. [Configuring with YAML](#configuring-with-yaml)
    5. [Configuring with Java Properties](#configuring-with-java-properties)
3. [Extending Mouse with plugins](#extending-mouse-with-plugins)
    1. [Writing a plugin in JavaScript](#writing-a-plugin-in-javascript)
        1. [Global JavaScript functions](#global-javascript-functions)
            1. [Join](#join)
            2. [Part](#part)
            3. [Cycle](#cycle)
            4. [Say](#say)
            5. [Kick](#kick)
            6. [Ban](#ban)
        2. [Global JavaScript data](#global-javascript-data)
            1. [Event](#event)
                1. [Command](#command)
                2. [Channel](#channel)
                3. [Message](#message)
                4. [Host](#host)
                5. [Nick](#nick)
                6. [User](#user)
4. [Contributing](#contributing)
5. [License](#license)

## Installing

### Building from source

Mouse is built on [Go](https://golang.org/), and uses [GB](https://getgb.io/) to vendor code. You should always be using the most recent version of both.

```bash
gb build all
```

### Downloading a binary

This option is currently not available, but will be once Mouse hits version `1.0.0`, and for each release after that.

## Configuring

Mouse uses the [Viper](https://github.com/spf13/viper) library, which allows a variety of configuration types. Your configuration file can exist at any of the following locations:

```bash
/etc/mouse/
$HOME/.mouse/
./
```

Your configuration file must be named appropriately and should be one of the following:

```bash
mouse.toml
mouse.json
mouse.hcl
mouse.yaml
mouse.properties
```

Keep in mind that a configuration file named `mouse.toml` MUST be a TOML file, and the same goes for every other supported configuration file type.

### Configuring with TOML

You can choose to configure Mouse with [TOML](https://github.com/toml-lang/toml). Configure your servers like this:

```toml
[servers]

    [server.a]
        nick = "mouse"

        # ...

        [servers.a.plugins.javascript]
            enabled = true

            # ...

    [server.b]
        nick = "mouse"

        # ...
```

You can see a full example at [contrib/config-examples/config.toml](contrib/config-examples/config.toml).

### Configuring with JSON

You can choose to configure Mouse with [JSON](http://www.json.org/). Configure your servers like this:

```json
{
    "servers": {
        "a": {
            "nick": "mouse",
            "plugins": {
                "javascript": {
                    "enabled": true
                }
            }
        },
        "b": {
            "nick": "mouse"
        }
    }
}
```

You can see a full example at [contrib/config-examples/config.json](contrib/config-examples/config.json).

### Configuring with HCL

You can choose to configure Mouse with [HCL](https://github.com/hashicorp/hcl). Configure your servers like this:

```hcl
servers "a" {
    nick = "mouse"

    # ...

    plugins "javascript" {
        enabled = true

        # ...
    }
}

servers "b" {
    nick = "mouse"

    # ...
}
```

You can see a full example at [contrib/config-examples/config.hcl](contrib/config-examples/config.hcl).

### Configuring with YAML

You can choose to configure Mouse with [YAML](http://yaml.org/). Configure your servers like this:

```yaml
servers:
    a:
        nick: mouse
        # ...

        plugins:
            javascript:
                enabled: true
                # ...
```

You can see a full example at [contrib/config-examples/config.yaml](contrib/config-examples/config.yaml).

### Configuring with Java Properties

You can choose to configure Mouse with [Java Properties](http://docs.oracle.com/javase/tutorial/essential/environment/properties.html).

```properties
servers.a.nick = "mouse"
# ...
servers.a.plugins.javascript.enabled = true
# ...

servers.b.nick = "mouse"
# ...
```

You can see a full example at [contrib/config-examples/config.properties](contrib/config-examples/config.properties).

## Extending Mouse with plugins

TODO

### Writing a plugin in JavaScript

TODO
<commit_msg>Update README to indent config types<commit_after>![Mouse](./vendor/mouse.jpg)

A scriptable, configuration powered IRC bot that can handle as many connnections as you want.

## Table of Contents

1. [Installing](#installing)
    1. [Building from source](#building-from-source)
    2. [Downloading a binary](#downloading-a-binary)
2. [Configuring](#configuring)
    1. [Choosing a configuration type](#choosing-a-configuration-type)
        1. [Configuring with TOML](#configuring-with-toml)
        2. [Configuring with JSON](#configuring-with-json)
        3. [Configuring with HCL](#configuring-with-hcl)
        4. [Configuring with YAML](#configuring-with-yaml)
        5. [Configuring with Java Properties](#configuring-with-java-properties)
3. [Extending Mouse with plugins](#extending-mouse-with-plugins)
    1. [Writing a plugin in JavaScript](#writing-a-plugin-in-javascript)
        1. [Global JavaScript functions](#global-javascript-functions)
            1. [Join](#join)
            2. [Part](#part)
            3. [Cycle](#cycle)
            4. [Say](#say)
            5. [Kick](#kick)
            6. [Ban](#ban)
        2. [Global JavaScript data](#global-javascript-data)
            1. [Event](#event)
                1. [Command](#command)
                2. [Channel](#channel)
                3. [Message](#message)
                4. [Host](#host)
                5. [Nick](#nick)
                6. [User](#user)
4. [Contributing](#contributing)
5. [License](#license)

## Installing

### Building from source

Mouse is built on [Go](https://golang.org/), and uses [GB](https://getgb.io/) to vendor code. You should always be using the most recent version of both.

```bash
gb build all
```

### Downloading a binary

This option is currently not available, but will be once Mouse hits version `1.0.0`, and for each release after that.

## Configuring

Mouse uses the [Viper](https://github.com/spf13/viper) library, which allows a variety of configuration types. Your configuration file can exist at any of the following locations:

```bash
/etc/mouse/
$HOME/.mouse/
./
```

Your configuration file must be named appropriately and should be one of the following:

```bash
mouse.toml
mouse.json
mouse.hcl
mouse.yaml
mouse.properties
```

Keep in mind that a configuration file named `mouse.toml` MUST be a TOML file, and the same goes for every other supported configuration file type.

### Choosing a configuration type

#### Configuring with TOML

You can choose to configure Mouse with [TOML](https://github.com/toml-lang/toml). Configure your servers like this:

```toml
[servers]

    [server.a]
        nick = "mouse"

        # ...

        [servers.a.plugins.javascript]
            enabled = true

            # ...

    [server.b]
        nick = "mouse"

        # ...
```

You can see a full example at [contrib/config-examples/config.toml](contrib/config-examples/config.toml).

### Configuring with JSON

You can choose to configure Mouse with [JSON](http://www.json.org/). Configure your servers like this:

```json
{
    "servers": {
        "a": {
            "nick": "mouse",
            "plugins": {
                "javascript": {
                    "enabled": true
                }
            }
        },
        "b": {
            "nick": "mouse"
        }
    }
}
```

You can see a full example at [contrib/config-examples/config.json](contrib/config-examples/config.json).

#### Configuring with HCL

You can choose to configure Mouse with [HCL](https://github.com/hashicorp/hcl). Configure your servers like this:

```hcl
servers "a" {
    nick = "mouse"

    # ...

    plugins "javascript" {
        enabled = true

        # ...
    }
}

servers "b" {
    nick = "mouse"

    # ...
}
```

You can see a full example at [contrib/config-examples/config.hcl](contrib/config-examples/config.hcl).

#### Configuring with YAML

You can choose to configure Mouse with [YAML](http://yaml.org/). Configure your servers like this:

```yaml
servers:
    a:
        nick: mouse
        # ...

        plugins:
            javascript:
                enabled: true
                # ...
    b:
        nick: mouse
        # ...
```

You can see a full example at [contrib/config-examples/config.yaml](contrib/config-examples/config.yaml).

#### Configuring with Java Properties

You can choose to configure Mouse with [Java Properties](http://docs.oracle.com/javase/tutorial/essential/environment/properties.html).

```properties
servers.a.nick = "mouse"
# ...
servers.a.plugins.javascript.enabled = true
# ...

servers.b.nick = "mouse"
# ...
```

You can see a full example at [contrib/config-examples/config.properties](contrib/config-examples/config.properties).

## Extending Mouse with plugins

TODO

### Writing a plugin in JavaScript

TODO

{'fraction_non_alphanumeric': 0.13527907967618236, 'fraction_numerical': 0.007136770345121432, 'mean_word_length': 2.515162860351928, 'pattern_counts': {'":': 16, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1905896', 'n_tokens_mistral': 2884, 'n_tokens_neox': 2717, 'n_words': 829}