Implement TIME command
Diff
src/client.rs | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
@@ -612,7 +612,23 @@
}
Command::STATS(_, _) => {}
Command::LINKS(_, _) => {}
Command::TIME(_) => {}
Command::TIME(_) => {
let time = chrono::Utc::now();
self.writer.write(Message {
tags: None,
prefix: Some(Prefix::ServerName(SERVER_NAME.to_string())),
command: Command::Response(
Response::RPL_TIME,
vec![
self.connection.nick.to_string(),
SERVER_NAME.to_string(),
time.timestamp().to_string(),
time.format("%a %b %d %Y %T").to_string(),
],
),
});
}
Command::CONNECT(_, _, _) => {}
Command::TRACE(_) => {}
Command::ADMIN(_) => {}