diff options
author | Hubert Hirtz <hubert.hirtz@laposte.net> | 2020-05-31 23:20:18 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert.hirtz@laposte.net> | 2020-06-03 15:41:51 +0200 |
commit | 881d63465cdb17357438763d4d2996d5f1d92fcd (patch) | |
tree | 36b1b7c852105d34ee2a8d71f6967b3e448ba3b7 /irc/events.go |
Initial commit
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 +} |