XMPP chatbot

media avatar 10 days ago
python support simple report msg 2 days ago
src helptext 2 days ago
.gitignore ignore build dir 12 days ago
README.md support simple report msg 2 days ago
makefile use threads instead of signals 10 days ago
roadmap.md roadmap 10 days ago
README.md

xmpp-bot

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

Core written in C using 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.

make

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

./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:

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

A convenience bash wrapper script ./python/report.sh is meant to be called by the xmpp-bot directly, activating the virtual environment and calling report.py