Added Core::IRC, a CTCP version reply and fixed the NAME,VER,SVER,REV,RSTAGE constants.
This commit is contained in:
1 parent
4b4f805c8f
commit
4dd3dbd09b
3 files changed
+45
-11
No files matched your search
@@ -16,23 +16,27 @@ use IO::Select;
|
||||
use Class::Unload;
|
||||
use FindBin qw($Bin);
|
||||
our $Bin = $Bin;
|
||||
BEGIN { unshift(@INC, "$Bin/../src"); }
|
||||
BEGIN {
|
||||
unshift(@INC, "$Bin/../src");
|
||||
|
||||
# Set version information.
|
||||
use constant {
|
||||
NAME => 'Auto IRC Bot',
|
||||
VER => 3,
|
||||
SVER => 0,
|
||||
REV => 0,
|
||||
RSTAGE => 'd'
|
||||
};
|
||||
}
|
||||
use API::Std qw(conf_get err cmd_add cmd_del);
|
||||
use API::Log qw(println alog dbug);
|
||||
use DB::Flatfile;
|
||||
use Parser::Config;
|
||||
use Parser::Lang;
|
||||
use Parser::IRC;
|
||||
#use Sys;
|
||||
use Core::IRC;
|
||||
|
||||
|
||||
# Set version information.
|
||||
use constant {
|
||||
NAME => 'Auto IRC Bot',
|
||||
VER => 3,
|
||||
SVER => 0,
|
||||
REV => 0,
|
||||
RSTAGE => 'd'
|
||||
};
|
||||
our $VERSION = 3.0.0;
|
||||
$0 = NAME;
|
||||
|
||||
@@ -284,6 +288,9 @@ else {
|
||||
}
|
||||
undef $it;
|
||||
|
||||
# Create core hooks.
|
||||
API::Std::hook_add("on_uprivmsg", "ctcp_version_reply", \&Core::IRC::version_reply);
|
||||
|
||||
# Infinite while loop.
|
||||
while (1) {
|
||||
# Timer check.
|
||||
|
||||
+3
-1
@@ -3,9 +3,11 @@ Auto IRC Bot 3.0: Change Log
|
||||
|
||||
3.0 Indev
|
||||
==================================================================
|
||||
* Fixed the NAME,VER,SVER,REV,RSTAGE constants.
|
||||
* Added a CTCP VERSION reply.
|
||||
* Created Core::IRC.
|
||||
* Added Bit.ly module
|
||||
|
||||
|
||||
3.0 Alpha 1
|
||||
==================================================================
|
||||
* Added mod_exists() to API::Std.
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# Auto IRC Bot. An advanced, lightweight and powerful IRC bot.
|
||||
# Copyright (C) 2010-2011 Xelhua Development Team (doc/CREDITS)
|
||||
# This program is free software; rights to this code are stated in doc/LICENSE.
|
||||
|
||||
# Core IRC functionality.
|
||||
package Core::IRC;
|
||||
use strict;
|
||||
use warnings;
|
||||
use English;
|
||||
use API::IRC qw(notice usrc);
|
||||
|
||||
sub version_reply
|
||||
{
|
||||
my (($svr, @ex)) = @_;
|
||||
my %src = usrc(substr($ex[0], 1));
|
||||
|
||||
if ($ex[3] eq ":\001VERSION\001") {
|
||||
notice($svr, $src{nick}, "VERSION ".Auto::NAME." ".Auto::VER.".".Auto::SVER.".".Auto::REV.Auto::RSTAGE." ".$OSNAME);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
Reference in new issue
Block a user