* Bug fix: The bot's nick is now stored correctly.
* Added server:modes config option for setting modes on connect.
This commit is contained in:
1 parent
bd547ea64a
commit
1ca0c9a078
4 files changed
+25
-6
No files matched your search
@@ -3,6 +3,9 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
==================================================================
|
==================================================================
|
||||||
|
* Bug fix: The bot's nick is now stored correctly.
|
||||||
|
* Added server:modes config option for setting modes on
|
||||||
|
connect.
|
||||||
* Parse TOPIC. (and added hook on_topic)
|
* Parse TOPIC. (and added hook on_topic)
|
||||||
* Added DB::Flatfile for DB:: database functions.
|
* Added DB::Flatfile for DB:: database functions.
|
||||||
* Added umode() to API::IRC.
|
* Added umode() to API::IRC.
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ server "Freenode" {
|
|||||||
bind 0.0.0.0;
|
bind 0.0.0.0;
|
||||||
# Identify to auth services via PRIVMSG.
|
# Identify to auth services via PRIVMSG.
|
||||||
idstr "PRIVMSG NickServ :IDENTIFY moocow12345";
|
idstr "PRIVMSG NickServ :IDENTIFY moocow12345";
|
||||||
|
# Modes on connect.
|
||||||
|
modes "+B";
|
||||||
# Single-line channel auto-join.
|
# Single-line channel auto-join.
|
||||||
ajoin "#freenode,#somebot";
|
ajoin "#freenode,#somebot";
|
||||||
}
|
}
|
||||||
@@ -40,6 +42,8 @@ server "Thinstack" {
|
|||||||
bind 0.0.0.0;
|
bind 0.0.0.0;
|
||||||
# Identify to auth services via an alias.
|
# Identify to auth services via an alias.
|
||||||
idstr "NS IDENTIFY moocow12345";
|
idstr "NS IDENTIFY moocow12345";
|
||||||
|
# Modes on connect.
|
||||||
|
modes "+B";
|
||||||
# Multi-line channel auto-join.
|
# Multi-line channel auto-join.
|
||||||
ajoin "#xelhua";
|
ajoin "#xelhua";
|
||||||
ajoin "#somebot";
|
ajoin "#somebot";
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ sub umode
|
|||||||
{
|
{
|
||||||
my ($svr, $modes) = @_;
|
my ($svr, $modes) = @_;
|
||||||
|
|
||||||
Auto::socksnd($svr, "MODE ".$Parser::IRC::botnick{$svr}." $modes");
|
Auto::socksnd($svr, "MODE ".$Parser::IRC::botnick{$svr}{nick}." $modes");
|
||||||
}
|
}
|
||||||
|
|
||||||
# Send a PRIVMSG.
|
# Send a PRIVMSG.
|
||||||
|
|||||||
+17
-5
@@ -72,6 +72,18 @@ sub num001
|
|||||||
|
|
||||||
$got_001{$svr} = 1;
|
$got_001{$svr} = 1;
|
||||||
|
|
||||||
|
# In case we don't get NICK from the server.
|
||||||
|
if (defined $botnick{$svr}{newnick}) {
|
||||||
|
$botnick{$svr}{nick} = $botnick{$svr}{newnick};
|
||||||
|
delete $botnick{$svr}{newnick};
|
||||||
|
}
|
||||||
|
|
||||||
|
# Modes on connect.
|
||||||
|
unless (!conf_get("server:$svr:modes")) {
|
||||||
|
my $connmodes = (conf_get("server:$svr:modes"))[0][0];
|
||||||
|
API::IRC::umode($svr, $connmodes);
|
||||||
|
}
|
||||||
|
|
||||||
# Identify string.
|
# Identify string.
|
||||||
unless (!conf_get("server:$svr:idstr")) {
|
unless (!conf_get("server:$svr:idstr")) {
|
||||||
my $idstr = (conf_get("server:$svr:idstr"))[0][0];
|
my $idstr = (conf_get("server:$svr:idstr"))[0][0];
|
||||||
@@ -82,7 +94,7 @@ sub num001
|
|||||||
my @cajoin = @{ (conf_get("server:$svr:ajoin"))[0] };
|
my @cajoin = @{ (conf_get("server:$svr:ajoin"))[0] };
|
||||||
|
|
||||||
# Join the channels.
|
# Join the channels.
|
||||||
unless (defined $cajoin[1]) {
|
if (!defined $cajoin[1]) {
|
||||||
# For single-line ajoins.
|
# For single-line ajoins.
|
||||||
my @sajoin = split(',', $cajoin[0]);
|
my @sajoin = split(',', $cajoin[0]);
|
||||||
|
|
||||||
@@ -218,7 +230,7 @@ sub cjoin
|
|||||||
my %src = API::IRC::usrc(substr($ex[0], 1));
|
my %src = API::IRC::usrc(substr($ex[0], 1));
|
||||||
|
|
||||||
# Check if this is coming from ourselves.
|
# Check if this is coming from ourselves.
|
||||||
if ($src{nick} eq $botnick{$svr}) {
|
if ($src{nick} eq $botnick{$svr}{nick}) {
|
||||||
# It is. Add channel to array and trigger on_ucjoin.
|
# It is. Add channel to array and trigger on_ucjoin.
|
||||||
unless (defined $botchans{$svr}) {
|
unless (defined $botchans{$svr}) {
|
||||||
@{ $botchans{$svr} } = (substr($ex[2], 1));
|
@{ $botchans{$svr} } = (substr($ex[2], 1));
|
||||||
@@ -244,9 +256,9 @@ sub nick
|
|||||||
my %src = API::IRC::usrc(substr($uex, 1));
|
my %src = API::IRC::usrc(substr($uex, 1));
|
||||||
|
|
||||||
# Check if this is coming from ourselves.
|
# Check if this is coming from ourselves.
|
||||||
if ($src{nick} eq $botnick{$svr}) {
|
if ($src{nick} eq $botnick{$svr}{nick}) {
|
||||||
# It is. Update bot nick hash.
|
# It is. Update bot nick hash.
|
||||||
$botnick{$svr} = $nex;
|
$botnick{$svr}{nick} = $nex;
|
||||||
delete $botnick{$svr}{newnick} if (defined $botnick{$svr}{newnick});
|
delete $botnick{$svr}{newnick} if (defined $botnick{$svr}{newnick});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -264,7 +276,7 @@ sub topic
|
|||||||
my %src = API::IRC::usrc(substr($ex[0], 1));
|
my %src = API::IRC::usrc(substr($ex[0], 1));
|
||||||
|
|
||||||
# Ignore it if it's coming from us.
|
# Ignore it if it's coming from us.
|
||||||
if (lc($src{nick}) ne lc($botnick{$svr})) {
|
if (lc($src{nick}) ne lc($botnick{$svr}{nick})) {
|
||||||
$src{chan} = $ex[2];
|
$src{chan} = $ex[2];
|
||||||
my (@argv);
|
my (@argv);
|
||||||
$argv[0] = substr($ex[3], 1);
|
$argv[0] = substr($ex[3], 1);
|
||||||
|
|||||||
Reference in new issue
Block a user