g1r/src/modules/kill.rs

18 lines
565 B
Rust

use crate::modules::Command;
pub struct KillCommand;
impl Command for KillCommand {
fn handle(&mut self, message: &str) -> Vec<String> {
let mut response = vec![];
if message.contains("PRIVMSG") && message.contains(":%kill") {
let channel = message.split("PRIVMSG ").nth(1).and_then(|s| s.splitn(2, ' ').next()).unwrap();
response.push(format!("PRIVMSG {} :SELF DESTRUCTING...\r\n", channel));
println!("[!] KILLING!");
std::process::exit(0);
}
response
}
}