pub struct Client { /* fields omitted */ }
Expand description
Creates a new client with a given Config
.
let mut client = Client::new(config).await?;
Returns error if the client could not connect to the host.
Panics if the client can’t connect to the given host.
Identify user and joins the in the Config
specified channels.
client.identify().await?;
Returns error if the client could not write to the stream.
Read data coming from the IRC as a commands::Command
.
loop {
if let Some(ref command) = client.read().await? {
if let commands::Command::PRIVMSG(nick, channel, message) = command {
println!("{} in {}: {}", nick, channel, message);
}
}
}
Returns IO errors from the TcpStream.
Request information about the admin of a given server.
client.admin("libera.chat").await?;
Returns IO errors from the TcpStream.
Set the status of the client.
client.away("afk").await?;
Returns IO errors from the TcpStream.
Invite someone to a channel.
client.invite("liblemonirc", "#async-circe").await?;
Returns IO errors from the TcpStream.
Join a channel.
client.join("#chaos").await?;
Returns IO errors from the TcpStream.
List available channels on an IRC, or users in a channel.
client.list(None, None).await?;
Returns IO errors from the TcpStream.
Set the mode for a user.
client.mode("test", Some("+B")).await?;
Returns IO errors from the TcpStream.
Get all the people online in channels.
client.names("#chaos,#async-circe", None).await?;
Returns IO errors from the TcpStream.
Change your nickname on a server.
client.nick("Not async-circe").await?;
Returns IO errors from the TcpStream.
Authentificate as an operator on a server.
client.oper("username", "password").await?;
Returns IO errors from the TcpStream.
Leave a channel.
client.part("#chaos").await?;
Returns IO errors from the TcpStream.
Tests the presence of a connection to a server.
client.ping("libera.chat", None).await?;
Returns IO errors from the TcpStream.
Send a message to a channel.
client.privmsg("#chaos", "Hello").await?;
Returns IO errors from the TcpStream.
Leave the IRC server you are connected to.
client.quit(None).await?;
Returns IO errors from the TcpStream.
Get the topic of a channel.
client.topic("#chaos", None).await?;
Set the topic of a channel.
client.topic("#chaos", Some("CHAOS")).await?;
Returns IO errors from the TcpStream.
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.