aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rwxr-xr-xidalius.pl10
2 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index 19c220b..3babafb 100644
--- a/README.md
+++ b/README.md
@@ -121,6 +121,12 @@ idalius to contact services like nickserv, memoserv, chanserv etc.
Not really useful apart from having a laugh in a channel. Really not sure why
I added this except for a lame gag or two. Worth it.
+### Set channel topic
+
+ topic #channel new topic
+
+Does what it says on the tin.
+
### Set channel/user modes
mode #channel +v someone
diff --git a/idalius.pl b/idalius.pl
index ea276dd..c88ed8e 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -284,6 +284,16 @@ sub irc_msg {
$irc->yield(privmsg => $nick => "Syntax: action <channel> <action text>");
}
}
+ if ($what =~ /^topic\s/) {
+ my ($channel, $topic) = $what =~ /^topic\s+(\S+)\s(.*)?$/;
+ if ($channel) {
+ $topic = "" unless $topic;
+ $irc->yield(topic => $channel => $topic);
+ $irc->yield(privmsg => $nick => "Requested.");
+ } else {
+ $irc->yield(privmsg => $nick => "Syntax: topic <channel> <topic>");
+ }
+ }
if ($what =~ /^mode\s/) {
my ($rest) = $what =~ /^mode\s+(.*)?$/;
if ($rest) {