From fa52c2e19ab1a2706361574371b8924d1e3e7c7a Mon Sep 17 00:00:00 2001
From: timriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Date: Sat, 21 Jan 2006 06:22:12 +0000
Subject: [PATCH] upper/lower case

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1266 c11ca15a-4712-0410-83d8-924469b57eb5
---
 blootbot/files/blootbot.help        |  8 ++++++++
 blootbot/files/sample/blootbot.chan |  3 ++-
 blootbot/src/CommandStubs.pl        |  2 ++
 blootbot/src/Modules/case.pl        | 20 ++++++++++++++++++++
 4 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 blootbot/src/Modules/case.pl

diff --git a/blootbot/files/blootbot.help b/blootbot/files/blootbot.help
index ae2e25d..5c00aa6 100644
--- a/blootbot/files/blootbot.help
+++ b/blootbot/files/blootbot.help
@@ -247,6 +247,10 @@ lart: U: ## [#chan] <who>
 lart: E: ## lenzo infobot's bugginess
 lart: E: ## #perl everyone perl \=\= lamerville
 
+lc: D: lower case a given string
+lc: U: ## <string>
+lc: E: ## When will blootbot achieve world domination?
+
 listauth: D: Search the factoid extension db by creator
 listauth: U: ## <search>
 listauth: E: ## xk
@@ -428,6 +432,10 @@ topic: NOTE: #chan arg is only required if command is sent over private message
 topic: NOTE: commands can be preceeded? with '-' in order not to enforce changes to topic.
 topic: End of help.
 
+uc: D: upper case a given string
+uc: U: ## <string>
+uc: E: ## When will blootbot achieve world domination?
+
 unforget: If a factoid has been forgotten, "unforget x" will cause me to unerase it.
 
 unlobotomy: Not possible in real life, an unlobotomy will bring me back to life in the case of a lobotomy.
diff --git a/blootbot/files/sample/blootbot.chan b/blootbot/files/sample/blootbot.chan
index 993f1e5..b0fe8b6 100644
--- a/blootbot/files/sample/blootbot.chan
+++ b/blootbot/files/sample/blootbot.chan
@@ -1,4 +1,4 @@
-#v1: blootbot -- InfoBot -- written Sat Jan  7 05:46:31 2006
+#v1: blootbot -- infobot -- written Sat Jan 21 06:17:24 2006
 
 #botpark
     -OnJoin
@@ -47,6 +47,7 @@ _default
     +allowTelling
     +babelfish
     +botmail
+    +case
     +cookie
     +countdown
     debianRefreshInterval 7
diff --git a/blootbot/src/CommandStubs.pl b/blootbot/src/CommandStubs.pl
index 0ad1430..00e1eba 100644
--- a/blootbot/src/CommandStubs.pl
+++ b/blootbot/src/CommandStubs.pl
@@ -877,6 +877,7 @@ sub nullski {
 &addCmdHook('karma', ('CODEREF' => 'karma', ) );
 &addCmdHook('kernel', ('CODEREF' => 'Kernel::Kernel', 'Forker' => 1, 'Identifier' => 'Kernel', 'Cmdstats' => 'Kernel', 'NoArgs' => 1) );
 &addCmdHook('lart', ('CODEREF' => 'lart', 'Identifier' => 'lart', 'Help' => 'lart') );
+&addCmdHook('lc', ('CODEREF' => 'case::lower', 'Identifier' => 'case', 'Cmdstats' => 'case', 'Forker' => 1, 'Module' => 'case') );
 &addCmdHook('listauth', ('CODEREF' => 'CmdListAuth', 'Identifier' => 'Search', Module => 'Factoids', 'Help' => 'listauth') );
 &addCmdHook('md5(sum)?', ('CODEREF' => 'md5::md5', 'Identifier' => 'md5', 'Cmdstats' => 'md5', 'Forker' => 1, 'Module' => 'md5') );
 &addCmdHook('metar', ('CODEREF' => 'Weather::Metar', 'Identifier' => 'Weather', 'Help' => 'weather', 'Cmdstats' => 'Weather', 'Forker' => 1) );
@@ -896,6 +897,7 @@ sub nullski {
 &addCmdHook('seen', ('CODEREF' => 'seen', 'Identifier' => 'seen') );
 &addCmdHook('slashdot', ('CODEREF' => 'Slashdot::Slashdot', 'Identifier' => 'slashdot', 'Forker' => 1, 'Cmdstats' => 'slashdot') );
 &addCmdHook('tell|explain', ('CODEREF' => 'tell', Help => 'tell', Identifier => 'allowTelling', Cmdstats => 'Tell') );
+&addCmdHook('uc', ('CODEREF' => 'case::upper', 'Identifier' => 'case', 'Cmdstats' => 'case', 'Forker' => 1, 'Module' => 'case') );
 &addCmdHook('Uptime', ('CODEREF' => 'uptime', 'Identifier' => 'Uptime', 'Cmdstats' => 'Uptime') );
 &addCmdHook('u(ser)?info', ('CODEREF' => 'userinfo', 'Identifier' => 'UserInfo', 'Help' => 'userinfo', 'Module' => 'UserInfo') );
 &addCmdHook('verstats', ('CODEREF' => 'do_verstats' ) );
diff --git a/blootbot/src/Modules/case.pl b/blootbot/src/Modules/case.pl
new file mode 100644
index 0000000..c41937c
--- /dev/null
+++ b/blootbot/src/Modules/case.pl
@@ -0,0 +1,20 @@
+#      case.pl: upper/lower a string
+#       Author: Tim Riker
+#    Licensing: Artistic License
+#      Version: v0.1
+#
+use strict;
+
+package case;
+
+sub upper {
+    my($message) = @_;
+    &::performStrictReply(uc $message);
+}
+
+sub lower {
+    my($message) = @_;
+    &::performStrictReply(lc $message);
+}
+
+1;
-- 
2.39.5