aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-03-07 15:50:48 +1300
committerDavid Phillips <david@sighup.nz>2017-03-07 15:50:48 +1300
commit51a140854c757f81cc7bc9b90a0175e185ec0e0e (patch)
treecad938ca8931ed6c88c8138f6a785da673c72a4c
parent30d44a6b8e05a0e31dca073e0f8d9092e35c8d61 (diff)
parente99c752927ba2e151ec887ea2e82e80d54ccea8c (diff)
downloadidalius-51a140854c757f81cc7bc9b90a0175e185ec0e0e.tar.xz
Merge branch 'master' into more-commands
-rw-r--r--bot.conf.example1
-rwxr-xr-xsaxrobot3
-rw-r--r--sb_config.pm2
3 files changed, 4 insertions, 2 deletions
diff --git a/bot.conf.example b/bot.conf.example
index 8b43c3a..6fc84f7 100644
--- a/bot.conf.example
+++ b/bot.conf.example
@@ -6,3 +6,4 @@ channels = #saxtalk,#bot
ignore = trumpetbot,abusiveuser
password = pleffquiffle
admins = snargle!~kleg@glarg.example.com
+must_id = 1
diff --git a/saxrobot b/saxrobot
index 2e56e4b..05a4315 100755
--- a/saxrobot
+++ b/saxrobot
@@ -14,6 +14,7 @@ my %config = sb_config::parse_config('bot.conf');
my $irc = POE::Component::IRC->spawn(
nick => $config{nick},
ircname => $config{ircname},
+ port => $config{port},
server => $config{server},
username => $config{username},
) or die "Failed to create new PoCo-IRC: $!";
@@ -84,7 +85,7 @@ sub irc_public {
sub irc_msg {
my ($who, $to, $what, $ided) = @_[ARG0, ARG1, ARG2, ARG3];
my $nick = (split /!/, $who)[0];
- if ($ided != 1) {
+ if ($config{must_id} && $ided != 1) {
$irc->yield(privmsg => $nick => "You must identify with services");
return;
}
diff --git a/sb_config.pm b/sb_config.pm
index f4e851e..d107147 100644
--- a/sb_config.pm
+++ b/sb_config.pm
@@ -8,7 +8,7 @@ use Config::Tiny;
sub parse_config
{
- my @scalar_configs = ('nick', 'username', 'ircname', 'server', 'password');
+ my @scalar_configs = ('nick', 'username', 'ircname', 'server', 'port', 'password', 'must_id');
my @list_configs = ('channels', 'ignore', 'admins');
my $file = $_[0];
my %built_config;