require at least 1 server

This commit is contained in:
Tiffany Bennett 2024-05-27 19:02:01 -07:00
parent b7cd376827
commit 38211e5a24
2 changed files with 6 additions and 1 deletions

View file

@ -46,7 +46,7 @@ path = "./currency.json"
# https://github.com/aatxe/irc?tab=readme-ov-file#configuring-irc-clients
owners = ["Tiffany"]
nickname = "rink"
realname = "rink-irc-bot"
realname = "rinkcalc.app"
server = "irc.libera.chat"
port = 6697
use_tls = true

View file

@ -84,6 +84,11 @@ async fn main() {
}
}
if config.servers.is_empty() {
println!("config.toml doesn't contain any servers");
std::process::exit(1);
}
let handles = (0..config.servers.len())
.map(|i| server_task(config.clone(), i))
.collect::<Vec<_>>();