<commit_before># FAbot

discord.py-based bot for the Folk ARPS Discord server.

Currently allows for the following commands:

- !help
    Gives a list of commands.
- !github
    Gives the github URL for the bot
- !armaserver
- !testserver
- !tsserver
    Gives the hostname and port number for the main ARMA server, test ARMA
    server and Teamspeak server.
- !nextevent
    Lists the next scheduled Folk ARPS session
- !status
    Reports the game status on the main Folk ARPS ARMA server
- !ping
    Reports the ping time to the main Folk ARPS ARMA server
- !info
    Reports information on the main Folk ARPS ARMA server including map name,
    player count, game state and game type
- !players
    Reports the player count on the main server and a list of the players
- !insurgency
    Reports information on the Folk ARPS Insurgency server
- !biki *pagename*
    Searches the Bohemia Interactive Wiki 

# Configuration
Copy file config.ini.sample and rename duplicate to config.ini
Inside config file, fill out email and password, and if you want to test on your own server, change channels.

# Installation
If you're using virtualenv (you should) create it in subfolder .venv (it's gitignored).
To install (should take care of dependencies):
    python setup.py develop

# Development
To add new commands, you'll need to edit two places: "class Commands" and "def on_message"

Commands is a helper class, that keeps all available commands. Why is that important? Because it helps you not to worry about !help command!
Just add new command to it with code like
    foo = Command('!foo', '!foo *bar*')
First parameter is command user has to type, and second one (optional) will show up instead of the command when !help is printed.

on_message is the place where you'll be adding new stuff.<commit_msg>Updated docs<commit_after># FAbot

discord.py-based bot for the Folk ARPS Discord server.

Currently allows for the following commands:

- !help
    Gives a list of commands.
- !github
    Gives the github URL for the bot
- !armaserver
- !testserver
- !tsserver
    Gives the hostname and port number for the main ARMA server, test ARMA
    server and Teamspeak server.
- !nextevent
    Lists the next scheduled Folk ARPS session
- !status
    Reports the game status on the main Folk ARPS ARMA server
- !ping
    Reports the ping time to the main Folk ARPS ARMA server
- !info
    Reports information on the main Folk ARPS ARMA server including map name,
    player count, game state and game type
- !players
    Reports the player count on the main server and a list of the players
- !insurgency
    Reports information on the Folk ARPS Insurgency server
- !biki *pagename*
    Searches the Bohemia Interactive Wiki 

# Configuration
Copy file config.ini.sample and rename duplicate to config.ini
Inside config file, fill out email and password, and if you want to test on your own server, change channels.

# Installation
If you're using virtualenv (you should) create it in subfolder .venv (it's gitignored).
To install (should take care of dependencies):
    python setup.py develop

# Development
To add new commands, you'll need to write a new function to do the actual
command, taking two arguments:
- *message* The actual discord message object which contains things like the
    channel, the author, the content and so on; and
- *args* Any arguments that follow the actual command itself (so in _"!foo bar"_,
    args would be 'bar'

Your function must test for the case where *message* is _None_, and return a
text string if it is; this is usage message, which gets reported by the FAbot
_!help_ command. 

Once your function is written, you must edit the *commands* dict and add an
entry linking the command name you want to use with your new function:

``` 
commands = {'usage'      : help,
            'help'       : help}
```

So here the user can use either _"!usage"_ or _"!help"_ and in both cases the
help() function will be called. 
{'fraction_non_alphanumeric': 0.05279110886587522, 'fraction_numerical': 0.0, 'mean_word_length': 3.642438452520516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4248137', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1067, 'n_words': 598}