Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created June 4, 2016 21:00
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/f7a75fe8d02b504591dca06cf0745514 to your computer and use it in GitHub Desktop.
Save zoffixznet/f7a75fe8d02b504591dca06cf0745514 to your computer and use it in GitHub Desktop.
unit package IRC::Client::Message;
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[]" }
}
constant M = IRC::Client::Message;
role Privmsg does M { has $.what; }
role Privmsg::Me does Privmsg { }
role Privmsg::Channel does Privmsg { has $.channel; }
role Notice does M { has $.what; }
role Notice::Me does Notice { }
role Notice::Channel does Notice { has $.channel; }
role Numeric does M { }
role Unknown does M { method Str { "❚⚠❚ $.command @.args[]" } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment