Added Core::IRC, a CTCP version reply and fixed the NAME,VER,SVER,REV,RSTAGE constants.

This commit is contained in:
Elijah Perrault committed 2011-02-01 19:08:59 -07:00
1 parent 4b4f805c8f
commit 4dd3dbd09b
3 files changed
+43 -9

No files matched your search

+15 -8
View File
@@ -16,14 +16,8 @@ use IO::Select;
use Class::Unload; use Class::Unload;
use FindBin qw($Bin); use FindBin qw($Bin);
our $Bin = $Bin; our $Bin = $Bin;
BEGIN { unshift(@INC, "$Bin/../src"); } BEGIN {
use API::Std qw(conf_get err cmd_add cmd_del); unshift(@INC, "$Bin/../src");
use API::Log qw(println alog dbug);
use DB::Flatfile;
use Parser::Config;
use Parser::Lang;
use Parser::IRC;
#use Sys;
# Set version information. # Set version information.
use constant { use constant {
@@ -33,6 +27,16 @@ use constant {
REV => 0, REV => 0,
RSTAGE => 'd' 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 Core::IRC;
our $VERSION = 3.0.0; our $VERSION = 3.0.0;
$0 = NAME; $0 = NAME;
@@ -284,6 +288,9 @@ else {
} }
undef $it; undef $it;
# Create core hooks.
API::Std::hook_add("on_uprivmsg", "ctcp_version_reply", \&Core::IRC::version_reply);
# Infinite while loop. # Infinite while loop.
while (1) { while (1) {
# Timer check. # Timer check.
+3 -1
View File
@@ -3,9 +3,11 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev 3.0 Indev
================================================================== ==================================================================
* Fixed the NAME,VER,SVER,REV,RSTAGE constants.
* Added a CTCP VERSION reply.
* Created Core::IRC.
* Added Bit.ly module * Added Bit.ly module
3.0 Alpha 1 3.0 Alpha 1
================================================================== ==================================================================
* Added mod_exists() to API::Std. * Added mod_exists() to API::Std.
+25
View File
@@ -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;