App::Statsbot - simple IRC bot that tracks time spent in a channel
use App::Statsbot; @App::Statsbot::CHANNELS = '#oooes'; $App::Statsbot::DEBUG = 1; App::Statsbot->run # Bot will respond to queries of the forms: # < mgv> !presence mgv # < mgv> presence mgv '1 day' # < mgv> BOTNICK: !presence mgv '1 year' 2 # < mgv> BOTNICK: presence mgv
App::Statsbot is a simple IRC bot that tracks the people that inhabit a channel. It is able to answer queries of the form "In the last <time interval>, how much time did <nick> spend in this channel?".
It is configured via global variables in the App::Statsbot package. These variables are initialized from environment variables with names of the form STATSBOT_DEBUG, STATSBOT_TICK, etc. In the case of array variables, the environment variable is treated as a space separated list. Each configuration variable has a default value used when it is not set explicitly or via the environment.
If true, print some debug information. Defaults to false.
How often (in seconds) to poll the channel for nicks. Defaults to 10 seconds.
The nickname of the bot. Defaults to "statsbot".
The IRC server. Defaults to "irc.freenode.net".
The port. Defaults to 6667.
If true, connect via SSL. Defaults to false.
Array of channels to connect to. Defaults to an empty array, which is not very useful.
Path to SQLite database. Must be writable. Will be created if it does not exist. Defaults to /var/lib/statsbot/db.
/var/lib/statsbot/db
After configuration, the bot can be started using the run function, which can be called as either a regular function or a method.
statsbot
Marius Gavrilescu, <marius@ieval.ro>
Copyright (C) 2013-2016 by Marius Gavrilescu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.2 or, at your option, any later version of Perl 5 you may have available.
To install App::Statsbot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Statsbot
CPAN shell
perl -MCPAN -e shell install App::Statsbot
For more information on module installation, please visit the detailed CPAN module installation guide.