3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-18 09:59:37 +01:00
pbot/pbot
2019-12-22 20:48:16 -08:00

60 lines
1.8 KiB
Perl
Executable File

#!/usr/bin/env perl
#
# File: pbot.pl
# Author: pragma_
#
# Purpose: IRC Bot (3rd generation)
########################
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
use feature 'unicode_strings';
use strict;
use warnings;
# bothome is automatically set by this script, do not modify
my $bothome;
BEGIN {
use File::Basename;
$bothome = -l __FILE__ ? dirname readlink __FILE__ : dirname __FILE__;
unshift @INC, $bothome;
}
my %config = (
# Path to data directory
data_dir => "$bothome/data",
# Path to directory containing command-line modules
module_dir => "$bothome/modules",
# Path to directory containing loadable plugins
plugin_dir => "$bothome/Plugins",
# Path to log file
log_file => "$bothome/log/log",
# -----------------------------------------------------
# The bot can export the latest factoids and quotegrabs to an HTML
# document. If you run a webserver or something similiar, you may
# wish to set the following items ending with 'path' to point to
# a suitable location for the webserver, and to set the items
# ending with 'site' to the public-facing URL where the files
# may be viewed in a browser.
# -----------------------------------------------------
export_factoids_path => "$bothome/factoids.html", # change to a path in your webroot
export_factoids_site => 'http://your.website.com/factoids.html',
export_quotegrabs_path => "$bothome/quotegrabs.html", # change to a path in your webroot
export_quotegrabs_site => 'http://your.website.com/quotegrabs.html',
);
# Create and initialize bot object
use PBot::PBot;
my $pbot = PBot::PBot->new(%config);
# Start the bot main loop; doesn't return
$pbot->start();