-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathmockmessage.go
88 lines (68 loc) · 1.66 KB
/
mockmessage.go
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package bruxism
type MockMessage struct {
id, channel, username, userid, avatar, message, rawMessage string
}
func NewMockMessage() *MockMessage {
return &MockMessage{}
}
// Functional options to set various properties
func (m *MockMessage) SetChannel(channel string) *MockMessage {
m.channel = channel
return m
}
func (m *MockMessage) SetUserName(username string) *MockMessage {
m.username = username
return m
}
func (m *MockMessage) SetUserID(userid string) *MockMessage {
m.userid = userid
return m
}
func (m *MockMessage) SetAvatar(avatar string) *MockMessage {
m.avatar = avatar
return m
}
func (m *MockMessage) SetMessage(message string) *MockMessage {
m.message = message
return m
}
func (m *MockMessage) SetRawMessage(message string) *MockMessage {
m.rawMessage = message
return m
}
func (m *MockMessage) SetMessageID(messageID string) *MockMessage {
m.id = messageID
return m
}
// Satisfy Message interface below
func (m *MockMessage) Channel() string {
return m.channel
}
func (m *MockMessage) UserName() string {
return m.username
}
func (m *MockMessage) UserID() string {
return m.userid
}
func (m *MockMessage) UserAvatar() string {
return m.avatar
}
func (m *MockMessage) Message() string {
return m.message
}
func (m *MockMessage) RawMessage() string {
return m.rawMessage
}
func (m *MockMessage) MessageID() string {
return m.id
}
func (m *MockMessage) Type() MessageType {
return MessageTypeCreate
}
func (m *MockMessage) MatchesCommand(prefix, command string) (bool, bool) {
return false, false
}
func (m *MockMessage) ParseCommand(prefix string) (string, []string, bool) {
return "", []string{}, false
}
var _ Message = &MockMessage{}