From 1260a3edade8f9738079b9934c93f83d6ecbc5d8 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Sun, 30 Jan 2011 13:43:15 -0700 Subject: [PATCH] Added topic() to API::IRC. --- doc/CHANGELOG | 1 + src/API/IRC.pm | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 466bcde..0e9f4c8 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev ================================================================== + * Added topic() to API::IRC. * Added has_priv() to API::Std. * Finished the host-based privilege/permission system. * Added hook on_preconnect, this comes before USER (after PASS). diff --git a/src/API/IRC.pm b/src/API/IRC.pm index 17f14bd..5812f0c 100644 --- a/src/API/IRC.pm +++ b/src/API/IRC.pm @@ -9,7 +9,8 @@ use warnings; use Exporter; our @ISA = qw(Exporter); -our @EXPORT_OK = qw(cjoin cpart cmode umode privmsg notice quit nick names usrc match_mask); +our @EXPORT_OK = qw(cjoin cpart cmode umode privmsg notice quit nick names topic + usrc match_mask); # Join a channel. @@ -99,6 +100,16 @@ sub names return 1; } +# Send a topic to the channel. +sub topic +{ + my ($svr, $chan, $topic) = @_; + + Auto::socksnd($svr, "TOPIC $chan :$topic"); + + return 1; +} + # Quit IRC. sub quit {