struct FastIRC::Message
- FastIRC::Message
- Struct
- Value
- Object
Overview
An IRC message containing command, parameters, prefix and IRCv3 tags.
To parse a line of IRC, see FastIRC.parse
or FastIRC.parse_line
.
Defined in:
fast_irc/message.crConstructors
-
.new(command : String, params : Nil | Array(String), *, prefix : FastIRC::Prefix | Nil = nil, tags : Nil | Hash(String, Nil | String) = nil)
m = FastIRC::Message.new("PRIVMSG", ["#WAMM", "testing message"]) m.to_s # => "PRIVMSG #WAMM :testing message\r\n"
Instance Method Summary
- #command : String
- #inspect(io)
- #params : Array(String) | Nil
-
#prefix : Prefix | Nil
See
Prefix
-
#tags : Tags | Nil
IRCv3 tags
-
#to_s(io)
Converts the message back into a raw IRC message, including trailing "\r\n".
Constructor Detail
def self.new(command : String, params : Nil | Array(String), *, prefix : FastIRC::Prefix | Nil = nil, tags : Nil | Hash(String, Nil | String) = nil)
#
m = FastIRC::Message.new("PRIVMSG", ["#WAMM", "testing message"])
m.to_s # => "PRIVMSG #WAMM :testing message\r\n"