# xmpp-bot

Very simple skeleton for a XMPP chatbot. It will start as an expense tracking bot. 

Core written in C using [libstrophe](https://strophe.im/libstrophe/). Grammar for messages is under `src/grammar/` written in Lex + Yacc.

If the necessity arises this should be a generic interface for a bot
that exposes functions such as `message_handler` that can parse and
react to messages.

## Building and running the XMPP bot

Requires `make`, `libstrophe` and `libssl` to be installed. See the `makefile` in the root directory of this repository.

```sh
make
```
This will compile an executable `./bin/xmpp-bot` that can be run with the appropriate CLI variables, such as:

```sh
./bin/xmpp-bot <bot@myserver.io> <test> <report-file.csv> <avatar-png-image.base64>
```

### Debugging

`make debug` will compile `./bin/debug/xmpp-bot` with `-g` debug flags turned on and optimization turned off.


## Running the pyhton report script

The `./python` subdirectory is meant to be used as a python3 virtual environment. Therefore it is necessary to install the required python3 packages prior to the first run:

```sh
python3 -m venv ./python
cd ./python
source ./bin/activate
python3 -m pip -r requirements.txt
```

