diff options
| author | Jokler <jokler.contact@gmail.com> | 2018-03-19 03:26:09 +0100 |
|---|---|---|
| committer | Jokler <jokler.contact@gmail.com> | 2018-03-19 03:26:09 +0100 |
| commit | 0e84a9c5cad2c5b8d4a2a9cff67c106ce4a47dfa (patch) | |
| tree | c6f20859805190a7beb6366a5cee89f23cba407e /src/main.rs | |
| parent | 47627f9219c75290125f980761b4ec9b5f6fe1f4 (diff) | |
| download | frippy-0e84a9c5cad2c5b8d4a2a9cff67c106ce4a47dfa.tar.gz frippy-0e84a9c5cad2c5b8d4a2a9cff67c106ce4a47dfa.zip | |
Use a prefix from the config instead of the nick
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 1070e9e..e0b50eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -121,17 +121,20 @@ fn run() -> Result<(), Error> { // Open a connection and add work for each config for config in configs { + let mut prefix = None; let mut disabled_plugins = None; let mut mysql_url = None; if let Some(ref options) = config.options { if let Some(disabled) = options.get("disabled_plugins") { disabled_plugins = Some(disabled.split(',').map(|p| p.trim()).collect::<Vec<_>>()); } + prefix = options.get("prefix"); mysql_url = options.get("mysql_url"); } + let prefix = prefix.map(|&ref s| s.clone()).unwrap_or(String::from(".")); - let mut bot = frippy::Bot::new(); + let mut bot = frippy::Bot::new(&prefix); bot.add_plugin(Help::new()); bot.add_plugin(Url::new(1024)); bot.add_plugin(Sed::new(60)); |
