From 5551ebd552af9363f16badb2b1700b34812b548a Mon Sep 17 00:00:00 2001 From: Adrian Malacoda Date: Sun, 26 Feb 2017 17:17:22 -0600 Subject: [PATCH] WIP for autolinker module. Currently can't use stc and tqm together because of conflicting dependencies, so this is a placeholder. --- Cargo.toml | 2 ++ src/lib.rs | 2 ++ src/modules/loader.rs | 2 ++ src/modules/mod.rs | 1 + tenquestionmarks.toml | 13 +++++++++++++ 5 files changed, 20 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 5d80bbd..1343dcc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,5 +13,7 @@ log = "0.3.6" env_logger = "0.4.0" transformable_channels = "0.1.1" time = "0.1" +regex = "0.2" pvn = { git = "http://gitlab.monarch-pass.net/malacoda/pvn.git" } echobox = { git = "http://gitlab.monarch-pass.net/malacoda/echobox.git" } +#stc = { git = "http://gitlab.monarch-pass.net/malacoda/stc.git" } diff --git a/src/lib.rs b/src/lib.rs index 2d95675..8c6640a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,8 @@ extern crate rand; extern crate pvn; extern crate echobox; extern crate transformable_channels; +//extern crate stc; +extern crate regex; #[macro_use] extern crate hlua; diff --git a/src/modules/loader.rs b/src/modules/loader.rs index 1ea6fc5..0b14d54 100644 --- a/src/modules/loader.rs +++ b/src/modules/loader.rs @@ -12,6 +12,7 @@ use modules::echo::EchoModule; use modules::random::RandomModule; use modules::pvn::PvnModule; use modules::echobox::EchoboxModule; +use modules::autolink::AutolinkModule; pub struct ModuleLoader { types: BTreeMap<&'static str, fn(&Table, &Table) -> Box> @@ -27,6 +28,7 @@ impl ModuleLoader { types.insert("random", RandomModule::new as fn(&Table, &Table) -> Box); types.insert("pvn", PvnModule::new as fn(&Table, &Table) -> Box); types.insert("echobox", EchoboxModule::new as fn(&Table, &Table) -> Box); + types.insert("autolink", AutolinkModule::new as fn(&Table, &Table) -> Box); ModuleLoader { types: types } diff --git a/src/modules/mod.rs b/src/modules/mod.rs index 34af65a..5e6b71d 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -5,6 +5,7 @@ pub mod echo; pub mod random; pub mod pvn; pub mod echobox; +pub mod autolink; pub mod loader; diff --git a/tenquestionmarks.toml b/tenquestionmarks.toml index ae6a800..1f89078 100644 --- a/tenquestionmarks.toml +++ b/tenquestionmarks.toml @@ -1,3 +1,6 @@ +[general] +foo = "bar" + [discord] token = "your token here" @@ -48,3 +51,13 @@ responses = ["ack"] [pvn] [echobox] + +[lua] +code = """ +function on_message (message, reply) + reply("Lua says: " .. message) +end +""" +foo = "bar" + +[autolink]