Enum circe::commands::Command [−][src]
pub enum Command {
Show 13 variants
ADMIN(String),
AWAY(String),
INVITE(String, String),
JOIN(String),
LIST(Option<String>, Option<String>),
MODE(String, Option<String>),
NAMES(String, Option<String>),
OPER(String, String),
OTHER(String),
PART(String),
PRIVMSG(String, String, String),
QUIT(String),
TOPIC(String, Option<String>),
// some variants omitted
}
Expand description
IRC commands
Variants
ADMIN(String)
Tuple Fields
0: String
Target
Gets information about the admin of the IRC server.
client.admin("192.168.178.100")?;
AWAY(String)
Tuple Fields
0: String
Message
Sets the user status to AWAY
client.away("AFK")?;
INVITE(String, String)
Invite user to channel
client.invite("liblirc", "#circe")?;
JOIN(String)
Tuple Fields
0: String
Channel
Joins a channel
client.join("#main")?;
LIST(Option<String>, Option<String>)
Lists all channels and their topics
client.list(None, None)?;
MODE(String, Option<String>)
Sets the mode of the user
client.mode("test", Some("+B"))?;
If the MODE is not given (e.g. None), then the client will send “MODE target”
NAMES(String, Option<String>)
List all nicknames visiable to the Client
client.names("#main,#circe", None)?;
OPER(String, String)
Attempts to identify as a channel operator
client.oper("username", "password")?;
OTHER(String)
Tuple Fields
0: String
Everything that is not a command
PART(String)
Tuple Fields
0: String
Target
Leave a channel
client.part("#main")?;
PRIVMSG(String, String, String)
Sends a message in a channel
client.privmsg("#main", "This is an example message")?;
QUIT(String)
Tuple Fields
0: String
Leave message
Leaves the IRC
client.quit(Some("Leaving..."))?;
TOPIC(String, Option<String>)
Sets or gets the topic of a channel
client.topic("#main", Some("main channel"))?;
Implementations
Creates a Command from a &str
. Currently only [PING]
and [PRIVMSG]
are supported.
Panics
This function will panic if the IRCd
sends malformed messages. Please contact the
maintainer of your IRCd
if this happens.