pub enum Message<'a> {
Show 19 variants
Ping,
Pong,
CapReq {
req: &'a str,
},
CapAck {
req: &'a str,
},
Pass {
pass: &'a str,
},
Nick {
nick: &'a str,
},
Join {
chan: &'a str,
},
Part {
chan: &'a str,
},
Privmsg {
tags: Option<Tags<'a>>,
chan: &'a str,
msg: &'a str,
},
Clearchat {
tags: Option<Tags<'a>>,
chan: &'a str,
usr: Option<&'a str>,
},
Clearmsg {
tags: Option<Tags<'a>>,
chan: &'a str,
msg: &'a str,
},
HosttargetStart {
host: &'a str,
chan: &'a str,
view: Option<u32>,
},
HosttargetEnd {
host: &'a str,
view: Option<u32>,
},
Notice {
tags: Option<Tags<'a>>,
chan: &'a str,
msg: &'a str,
},
Reconnect,
Roomstate {
tags: Option<Tags<'a>>,
chan: &'a str,
},
Usernotice {
tags: Option<Tags<'a>>,
chan: &'a str,
msg: &'a str,
},
Userstate {
tags: Option<Tags<'a>>,
chan: &'a str,
},
GlobalUserstate {
tags: Option<Tags<'a>>,
},
}
Expand description
Possible types of TMI messages.
Unrecognized messages are handled by the associated [parse
] function.
Tags are always treated as Optional even on messages that require them. Actually, tags validation should be done by the user code.
Consider changing simple enum structs to enum tuples.
Variants§
Ping
Represents a ping request message.
PING :<endpoint>
Pong
Represents a pong response message.
PONG :<endpoint>
CapReq
Represents a capability request message.
CAP REQ :<capability>
CapAck
Represents a capability acknowledgement message.
:<endpoint> CAP * ACK :<capability>
Pass
Represents a password authentication message.
PASS <password>
PASS oauth:<token>
(using Twitch OAuth tokens)
Nick
Represents a nickname authentication message.
NICK <user>
Join
Represents a join command message.
JOIN #<channel>
Part
Represents a part command message.
PART #<channel>
Privmsg
Represents a privmsg command message.
[@<tags>] PRIVMSG #<channel> :<message>
Clearchat
Represents a clearchat command message.
[@<tags>] :<endpoint> CLEARCHAT #<channel> [:<user>]
Clearmsg
Represents a clearmsg command message.
[@<tags>] :<endpoint> CLEARMSG #<channel> [:<message>]
HosttargetStart
Represents a hosttarget start message.
:<endpoint> HOSTTARGET #<host> :<channel> [<viewers>]
HosttargetEnd
Represents a hosttarget end message.
:<endpoint> HOSTTARGET #<host> :- [<viewers>]
Notice
Represents a notice message.
[@<tags>] :<endpoint> NOTICE #<channel> :<message>
Reconnect
Represents a reconnect request message.
RECONNECT
Roomstate
Represents a roomstate message.
[@<tags>] :<endpoint> ROOMSTATE #<channel>
Usernotice
Represents a usernotice message.
[@<tags>] :<endpoint> USERNOTICE #<channel> :<message>
Userstate
Represents a userstate message.
[@<tags>] :<endpoint> USERSTATE #<channel>
GlobalUserstate
Represents a global userstate message.
[@<tags>] :<endpoint> GLOBALUSERSTATE