Struct circe::Client [−][src]
pub struct Client { /* fields omitted */ }
Expand description
An IRC client
Implementations
Read data coming from the IRC as a commands::Command
.
if let Ok(ref command) = client.read() {
if let Command::OTHER(line) = command {
print!("{}", line);
}
}
Errors
Returns error if there are no new messages. This should not be taken as an actual error, because nothing went wrong.
Send a commands::Command
to the IRC.
Not reccomended to use, use the helper functions instead.
client.write_command(Command::PRIVMSG("".to_string(), "#main".to_string(), "Hello".to_string()))?;
Errors
Returns error if the client could not write to the stream.
Helper function for requesting information about the ADMIN of an IRC server
client.admin("192.168.178.100")?;
Errors
Returns error if the client could not write to the stream.
Helper function for setting the users status to AWAY
client.away("AFK")?;
Errors
Returns error if the client could not write to the stream.
Helper function for sending PRIVMSGs.
client.privmsg("#main", "Hello")?;
Errors
Returns error if the client could not write to the stream.
Helper function to INVITE people to a channels
client.invite("liblirc", "#circe")?;
Errors
Returns error if the client could not write to the stream.
Helper function for sending JOINs.
client.join("#main")?;
Errors
Returns error if the client could not write to the stream.
Helper function for LISTing
channels and modes
client.list(None, None)?;
Errors
Returns error if the client could not write to the stream.
Helper function for getting all nicknames in a channel
client.names("#main,#circe", None)?;
Errors
Returns error if the client could not write to the stream.
Helper function to try to register as a channel operator
client.oper("username", "password")?;
Errors
Returns error if the client could not write to the stream.
Helper function for sending MODEs.
client.mode("test", Some("+B"))?;
Errors
Returns error if the client could not write to the stream.
Helper function for leaving channels.
client.part("#main")?;
Errors
Returns error if the client could not write to the stream.
Helper function for setting or getting the topic of a channel
client.topic("#main", Some("main channel"))?;
Errors
Returns error if the client could not write to the stream.