Write a method of the IRC structure called Dispatch that takes commands (PRIVMSG, WHISPER, PASS, NICK, CAP REQ, JOIN, PONG etc.), content, and metadata and writes IRC lines to the server.
This will abstract and centralize the logic responsible for packaging data into IRC lines before sending to irc.Write().
We could also accomplish this by writing a method for each command. It seems this may be closer to the standard practice. We can still group them together in irc.go
Write a method of the
IRC
structure calledDispatch
that takes commands (PRIVMSG
,WHISPER
,PASS
,NICK
,CAP REQ
,JOIN
,PONG
etc.), content, and metadata and writes IRC lines to the server.This will abstract and centralize the logic responsible for packaging data into IRC lines before sending to
irc.Write()
.