From bab20f6b99ddd4d7bdcab215ae75386c5bd40564 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Tue, 25 Aug 2009 13:49:27 +0200 Subject: [PATCH] say and cmd commands for better bot control --- Commands/Basic.pm | 21 +++++++++++++++++++++ database/roles.sql | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/Commands/Basic.pm b/Commands/Basic.pm index f040487..fd30f0f 100644 --- a/Commands/Basic.pm +++ b/Commands/Basic.pm @@ -59,5 +59,26 @@ sub help . "Instead of . you can use ! to get reply in pm or ~ to get reply in channel."); } +sub say + : Help(.say target message | sends message to target) + : Type(pm) + : ACL(irc_say) +{ + my ($self, $c, $msg) = @_; + my ($target,$message) = $msg =~ /^(\S+)\s+(.+)$/ or die 'ARGS'; + + $c->message(privmsg => $target => $message ); +} + +sub cmd + : Help(.run command args | run a given command) + : Type(pm) + : ACL(irc_cmd) +{ + my ($self, $c, $msg) = @_; + + $c->command(split /\s/, $msg); +} + 1; diff --git a/database/roles.sql b/database/roles.sql index b649f48..7cfa563 100644 --- a/database/roles.sql +++ b/database/roles.sql @@ -40,6 +40,8 @@ INSERT INTO roles VALUES('irc_forum_others'); INSERT INTO roles VALUES('irc_newtag'); INSERT INTO roles VALUES('irc_addtag'); INSERT INTO roles VALUES('irc_deltag'); +INSERT INTO roles VALUES('irc_say'); +INSERT INTO roles VALUES('irc_cmd'); INSERT INTO group_roles (gid,role) VALUES('T','irc_p_nick'); INSERT INTO group_roles (gid,role) VALUES('T','irc_p_intel'); @@ -78,6 +80,8 @@ INSERT INTO group_roles (gid,role) VALUES('T','irc_getcalc'); INSERT INTO group_roles (gid,role) VALUES('T','irc_sendsms'); INSERT INTO group_roles (gid,role) VALUES('T','irc_smsstatus'); INSERT INTO group_roles (gid,role) VALUES('T','irc_forum_others'); +INSERT INTO group_roles (gid,role) VALUES('T','irc_say'); +INSERT INTO group_roles (gid,role) VALUES('T','irc_cmd'); INSERT INTO group_roles (gid,role) VALUES('M','irc_gs'); INSERT INTO group_roles (gid,role) VALUES('M','irc_scan'); -- 2.39.2