<commit_before># Botnet
IRC bot written in Python.

## Usage

    botnet --help
    botnet run --help
    botnet run /path/to/config.json

## Example config

    {
        "modules": ["irc", "meta", "tell"],
        "module_config": {
            "irc": {
                "server": "irc.example.com",
                "port": 6667,
                "ssl": false,
                "nick": "my_bot",
                "channels": [
                    {
                        "name": "#my-channel",
                        "password": <PASSWORD>
                    }
                ],
                "autosend": [
                    "PRIVMSG your_nick :I connected!"
                ]
            },
            "base_responder": {
                "command_prefix": "."
            },
            "tell": {
                "data_file": "/path/to/data_file.json"
            }
        }
    }

## Creating external modules
The easiest way to create a module is to subclass
`botnet.modules.BaseResponder`. For details see a simple built-in module
`botnet.modules.meta`.

External modules must follow a few simple rules:

* Python module name should start with `botnet_`
* it should be possible to import a variable `mod` from that Python module
* variable `mod` should be pointing to a class which is a child of
`botnet.modules.BaseIdleModule`
* if a module requires additional configuration it should be stored in
`module_config->external_module_name`

To load an external module it is necessary it to install and add it to
`modules` in the config file. Example:


    {<commit_msg>Updated README.<commit_after># Botnet
IRC bot written in Python.

## Usage

    botnet --help
    botnet run --help
    botnet run /path/to/config.json

## Example config

    {
        "modules": ["irc", "meta"],
        "module_config": {
            "irc": {
                "server": "irc.example.com",
                "port": 6697,
                "ssl": true,
                "nick": "my_bot",
                "channels": [
                    {
                        "name": "#my-channel",
                        "password": <PASSWORD>
                    }
                ],
                "autosend": [
                    "PRIVMSG your_nick :I connected!"
                ]
            },
            "base_responder": {
                "command_prefix": "."
            }
        }
    }

## Creating external modules
The easiest way to create a module is to subclass
`botnet.modules.BaseResponder`. For details see a simple built-in module
`botnet.modules.meta`.

External modules must follow a few simple rules:

* Python module name should start with `botnet_`
* it should be possible to import a variable `mod` from that Python module
* variable `mod` should be pointing to a class which is a child of
`botnet.modules.BaseIdleModule`
* if a module requires additional configuration it should be stored in
`module_config->external_module_name`

To load an external module it is necessary to install it and add it to
`modules` in the config file. Example:


    {
{'fraction_non_alphanumeric': 0.09833387781770664, 'fraction_numerical': 0.0026135249918327343, 'mean_word_length': 1.6836108676599475, 'pattern_counts': {'":': 28, '<': 5, '<?xml version=': 0, '>': 7, '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': '389846', 'n_tokens_mistral': 850, 'n_tokens_neox': 790, 'n_words': 285}