From f775ddc61b8888277c21f890ce28bf9bb260f5e5 Mon Sep 17 00:00:00 2001 From: MallocNull Date: Tue, 18 Nov 2014 14:25:16 -0600 Subject: [PATCH] sql update AGAIN !! i fucked it up but now it's good --- bot/bot/bot.csproj | 1 + bot/bot/conditions/msglen.cs | 17 +++++++++++++++++ sql/autonomous_fix.sql | 3 ++- sql/structure.sql | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 bot/bot/conditions/msglen.cs diff --git a/bot/bot/bot.csproj b/bot/bot/bot.csproj index 919c403..981d63e 100644 --- a/bot/bot/bot.csproj +++ b/bot/bot/bot.csproj @@ -83,6 +83,7 @@ + diff --git a/bot/bot/conditions/msglen.cs b/bot/bot/conditions/msglen.cs new file mode 100644 index 0000000..357bd0c --- /dev/null +++ b/bot/bot/conditions/msglen.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace bot.conditions { + class msglen { + static public string[] getInfo() { + return new string[] { typeof(msglen).Name, "message length over" }; + } + + static public bool performCheck(Message msg, string parameter) { + return msg.msg.Length >= Int32.Parse(parameter); + } + } +} diff --git a/sql/autonomous_fix.sql b/sql/autonomous_fix.sql index 95326e5..cce9358 100644 --- a/sql/autonomous_fix.sql +++ b/sql/autonomous_fix.sql @@ -1 +1,2 @@ -ALTER TABLE `autonomous` CHANGE `starttime` `starttime` VARCHAR( 6 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '-1,-1' \ No newline at end of file +ALTER TABLE `autonomous` CHANGE `starttime` `starttime` VARCHAR( 6 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '-1,-1' +ALTER TABLE `autonomous` ADD `name` varchar(255) \ No newline at end of file diff --git a/sql/structure.sql b/sql/structure.sql index 6133d9e..018bef5 100644 --- a/sql/structure.sql +++ b/sql/structure.sql @@ -16,6 +16,7 @@ CREATE TABLE IF NOT EXISTS `admin` ( CREATE TABLE IF NOT EXISTS `autonomous` ( `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, `startday` int(11) NOT NULL DEFAULT '-1', `starttime` varchar(6) NOT NULL DEFAULT '-1,-1', `periodicity` bigint(20) NOT NULL DEFAULT '1440',