summaryrefslogtreecommitdiff
path: root/irc/events.go
blob: c2af056de02e1825bba5d52439a0f3f8bc30a53b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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 SelfPartEvent struct {
	ChannelEvent
}

type UserPartEvent 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
}