Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created June 4, 2016 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/0315a0330dc3cda0b6d9522f6dbd1290 to your computer and use it in GitHub Desktop.
Save zoffixznet/0315a0330dc3cda0b6d9522f6dbd1290 to your computer and use it in GitHub Desktop.
role IRC::Client::Message {
has $.irc is required;
has Str:D $.nick is required;
has Str:D $.username is required;
has Str:D $.host is required;
has Str:D $.usermask is required;
has Str:D $.command is required;
has Str:D $.server is required;
has @.args is required;
method Str { "$.command @.args[]" }
}
role IRC::Client::Message::Privmsg does IRC::Client::Message {
has $.what;
}
role IRC::Client::Message::Privmsg::Channel does IRC::Client::Message::Privmsg {
has $.channel;
}
role IRC::Client::Message::Privmsg::Me does IRC::Client::Message::Privmsg {}
role IRC::Client::Message::Unknown does IRC::Client::Message {
method Str { "❚⚠❚ $.command @.args[]" }
}
role IRC::Client::Message::Numeric does IRC::Client::Message {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment