2023-02-17 08:38:32 +00:00
|
|
|
|
|
|
|
use crate::modules::Command;
|
|
|
|
|
|
|
|
pub struct KillCommand;
|
|
|
|
impl Command for KillCommand {
|
2023-03-29 03:26:56 +00:00
|
|
|
fn handle(&mut self, message: &str) -> Vec<String> {
|
2023-02-17 08:38:32 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|