gempir

Untitled

Mar 11th, 2017
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.41 KB | None | 0 0
  1. package twitch
  2.  
  3. import "time"
  4.  
  5. type Message interface {
  6.     getType() string
  7. }
  8.  
  9. type PRIVMSG struct {
  10.     Text      string
  11.     User      User
  12.     Channel   Channel
  13.     Timestamp time.Time
  14. }
  15.  
  16. func (m *PRIVMSG) getType() string {
  17.     return "PRIVMSG"
  18. }
  19.  
  20. func newPRIVMSG(text string, user User, channel Channel) PRIVMSG {
  21.     return PRIVMSG{
  22.         Text: text,
  23.         User: user,
  24.         Channel: channel,
  25.         Timestamp: time.Now(),
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment