diff options
Diffstat (limited to 'irc/events.go')
-rw-r--r-- | irc/events.go | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/irc/events.go b/irc/events.go new file mode 100644 index 0000000..2cd5214 --- /dev/null +++ b/irc/events.go @@ -0,0 +1,52 @@ +package irc + +import ( + "strings" + "time" +) + +type Event interface{} + +type RegisteredEvent struct{} + +type UserEvent struct { + Nick string + User string + Host string +} + +func (u UserEvent) NickMapped() (nick string) { + nick = strings.ToLower(u.Nick) + return +} + +type ChannelEvent struct { + Channel string +} + +func (c ChannelEvent) ChannelMapped() (channel string) { + channel = strings.ToLower(c.Channel) + return +} + +type UserJoinEvent struct { + UserEvent + ChannelEvent +} + +type SelfJoinEvent struct { + ChannelEvent +} + +type QueryMessageEvent struct { + UserEvent + Content string + Time time.Time +} + +type ChannelMessageEvent struct { + UserEvent + ChannelEvent + Content string + Time time.Time +} |