aboutsummaryrefslogtreecommitdiff
path: root/web/revolt/handler.go
blob: c88c74426fccef0340c507b587e4172c307b6af9 (plain)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package revolt

import "context"

type NullHandler struct{}

func (NullHandler) UnknownEvent(context.Context, string, []byte) error { return nil }
func (NullHandler) Ready(context.Context) error                        { return nil }
func (NullHandler) Authenticated(context.Context) error                { return nil }
func (NullHandler) MessageCreate(context.Context, *Message) error      { return nil }
func (NullHandler) MessageAppend(context.Context, string, string, *MessageAppend) error {
	return nil
}
func (NullHandler) MessageDelete(context.Context, string, string) error { return nil }
func (NullHandler) MessageUpdate(context.Context, string, string, *Message) error {
	return nil
}
func (NullHandler) MessageReact(context.Context, string, string, string, string) error {
	return nil
}
func (NullHandler) MessageUnreact(context.Context, string, string, string, string) error {
	return nil
}
func (NullHandler) MessageRemoveReaction(context.Context, string, string, string) error {
	return nil
}
func (NullHandler) ChannelCreate(context.Context, *Channel) error { return nil }
func (NullHandler) ChannelUpdate(context.Context, string, *Channel, []string) error {
	return nil
}
func (NullHandler) ChannelDelete(context.Context, string) error { return nil }
func (NullHandler) ChannelAck(context.Context, string, string, string) error {
	return nil
}
func (NullHandler) ChannelStartTyping(context.Context, string, string) error {
	return nil
}
func (NullHandler) ChannelStopTyping(context.Context, string, string) error {
	return nil
}
func (NullHandler) ChannelGroupJoin(context.Context, string, string) error {
	return nil
}
func (NullHandler) ChannelGroupLeave(context.Context, string, string) error {
	return nil
}
func (NullHandler) ServerCreate(context.Context, *Server) error { return nil }
func (NullHandler) ServerUpdate(context.Context, string, *Server, []string) error {
	return nil
}
func (NullHandler) ServerDelete(context.Context, string) error { return nil }
func (NullHandler) ServerMemberJoin(context.Context, string, string) error {
	return nil
}
func (NullHandler) ServerMemberLeave(context.Context, string, string) error {
	return nil
}
func (NullHandler) ServerMemberUpdate(context.Context, string, string, *Member, []string) error {
	return nil
}
func (NullHandler) ServerRoleCreate(context.Context, string, *Role) error {
	return nil
}
func (NullHandler) ServerRoleUpdate(context.Context, string, string, *Role, []string) error {
	return nil
}
func (NullHandler) ServerRoleDelete(context.Context, string, string) error {
	return nil
}
func (NullHandler) ServerChannelCreate(context.Context, string, *Channel) error {
	return nil
}
func (NullHandler) ServerChannelUpdate(context.Context, string, string, *Channel, []string) error {
	return nil
}
func (NullHandler) ServerChannelDelete(context.Context, string, string) error {
	return nil
}
func (NullHandler) UserUpdate(context.Context, string, *User, []string) error { return nil }
func (NullHandler) UserRelationship(context.Context, string, *User, string) error {
	return nil
}
func (NullHandler) UserPlatformWipe(context.Context, string, string) error {
	return nil
}
func (NullHandler) EmojiCreate(context.Context, *Emoji) error {
	return nil
}
func (NullHandler) EmojiDelete(context.Context, string) error {
	return nil
}

type Handler interface {
	UnknownEvent(ctx context.Context, kind string, data []byte) error
	Authenticated(context.Context) error
	Ready(context.Context) error

	// Messages

	MessageCreate(ctx context.Context, message *Message) error
	MessageAppend(ctx context.Context, channelID, messageID string, data *MessageAppend) error
	MessageDelete(ctx context.Context, channelID, messageID string) error
	MessageUpdate(ctx context.Context, channelID, messageID string, data *Message) error
	MessageReact(ctx context.Context, messageID, channelID, userID, emojiID string) error
	MessageUnreact(ctx context.Context, messageID, channelID, userID, emojiID string) error
	MessageRemoveReaction(ctx context.Context, messageID, channelID, emojiID string) error

	// Channels

	ChannelCreate(ctx context.Context, channel *Channel) error
	ChannelUpdate(ctx context.Context, channelID string, channel *Channel, clear []string) error
	ChannelDelete(ctx context.Context, channelID string) error
	ChannelAck(ctx context.Context, channelID, userID, messageID string) error
	ChannelStartTyping(ctx context.Context, channelID, userID string) error
	ChannelStopTyping(ctx context.Context, channelID, userID string) error

	// User groups

	ChannelGroupJoin(ctx context.Context, channelID, userID string) error
	ChannelGroupLeave(ctx context.Context, channelID, userID string) error

	// Servers

	ServerCreate(ctx context.Context, srv *Server) error
	ServerUpdate(ctx context.Context, serverID string, srv *Server, clear []string) error
	ServerDelete(ctx context.Context, serverID string) error
	ServerMemberUpdate(ctx context.Context, serverID, userID string, data *Member, clear []string) error
	ServerMemberJoin(ctx context.Context, serverID, userID string) error
	ServerMemberLeave(ctx context.Context, serverID, userID string) error
	ServerRoleUpdate(ctx context.Context, serverID, roleID string, role *Role, clear []string) error
	ServerRoleDelete(ctx context.Context, serverID, roleID string) error

	// Users
	UserUpdate(ctx context.Context, userID string, user *User, clear []string) error
	UserRelationship(ctx context.Context, userID string, user *User, status string) error
	UserPlatformWipe(ctx context.Context, userID string, flags string) error

	// Emoji
	EmojiCreate(ctx context.Context, emoji *Emoji) error
	EmojiDelete(ctx context.Context, emojiID string) error
}