From a5316e514b05f8f0bb9dc745ede654a968e41cc1 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 10 Apr 2018 21:56:09 +1200 Subject: Add topic change command --- README.md | 6 ++++++ idalius.pl | 10 ++++++++++ 2 files changed, 16 insertions(+) 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 "); } } + 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 "); + } + } if ($what =~ /^mode\s/) { my ($rest) = $what =~ /^mode\s+(.*)?$/; if ($rest) { -- cgit v1.1