-
Notifications
You must be signed in to change notification settings - Fork 1
/
webhook.go
253 lines (198 loc) · 5.48 KB
/
webhook.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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
package guildedgo
type Webhook struct {
ID string `json:"id"`
Name string `json:"name"`
ServerID string `json:"serverId"`
ChannelID string `json:"channelId"`
CreatedAt string `json:"createdAt"`
CreatedBy string `json:"createdBy"`
DeletedAt string `json:"deletedAt"`
Token string `json:"string"`
}
type BotServerMembershipCreated struct {
Server `json:"server"`
// The ID of the user who created this server membership
CreatedBy string `json:"createdBy"`
}
type BotServerMembershipDeleted struct {
Server `json:"server"`
// The ID of the user who deleted this server membership
CreatedBy string `json:"createdBy"`
}
type ChatMessageCreated struct {
// The ID of the server
ServerID string `json:"serverId"`
Message ChatMessage `json:"message"`
}
type ChatMessageUpdated struct {
// The ID of the server
ServerID string `json:"serverId"`
Message ChatMessage `json:"message"`
}
type ChatMessageDeleted struct {
// The ID of the server
ServerID string `json:"serverId"`
Message struct {
// The ID of the message
ID string `json:"id"`
// The ID of the serve
ServerID string `json:"serverId,omitempty"`
// The ID of the channel
ChannelID string `json:"channelId"`
DeletedAt string `json:"deletedAt"`
IsPrivate bool `json:"isPrivate,omitempty"`
} `json:"message"`
}
type ServerMemberJoined struct {
// The ID of the server
ServerID string `json:"serverId"`
Member ServerMember `json:"member"`
}
type ServerMemberRemoved struct {
// The ID of the server
ServerID string `json:"serverId"`
// The ID of the user
UserID string `json:"userId"`
// If this member leaving was the result of a kick
IsKick bool `json:"isKick,omitempty"`
// If this member leaving was the result of a ban
IsBan bool `json:"isBan,omitempty"`
}
type ServerMemberBanned struct {
// The ID of the server
ServerID string `json:"serverId"`
ServerMemberBan `json:"serverMemberBan"`
}
type ServerMemberUnbanned struct {
// The ID of the server
ServerID string `json:"serverId"`
ServerMemberBan `json:"serverMemberBan"`
}
type ServerMemberUpdated struct {
// The ID of the server
ServerID string `json:"serverId"`
UserInfo struct {
// The ID of the user
ID string `json:"userId"`
// The nickname that was just updated for the user
Nickname string `json:"nickname,omitempty"`
} `json:"userInfo"`
}
type ServerRolesUpdated struct {
// The ID of the server
ServerID string `json:"serverId"`
MemberRoleIds struct {
UserID string `json:"userId"`
RoleIDs []int `json:"roleIds"`
} `json:"memberRoleIds"`
}
type ServerChannelCreated struct {
ServerID string `json:"serverId"`
Channel ServerChannel `json:"channel"`
}
type ServerChannelUpdated struct {
ServerID string `json:"serverId"`
Channel ServerChannel `json:"channel"`
}
type ServerChannelDeleted struct {
ServerID string `json:"serverId"`
Channel ServerChannel `json:"channel"`
}
type ServerWebhookCreated struct {
ServerID string `json:"serverId"`
Webhook `json:"webhook"`
}
type ServerWebhookUpdated struct {
ServerID string `json:"serverId"`
Webhook `json:"webhook"`
}
type DocCreated struct {
ServerID string `json:"serverId"`
Doc `json:"doc"`
}
type DocUpdated struct {
ServerID string `json:"serverId"`
Doc `json:"doc"`
}
type DocDeleted struct {
ServerID string `json:"serverId"`
Doc `json:"doc"`
}
type CalendarEventCreated struct {
ServerID string `json:"serverId"`
CalendarEvent `json:"calendarEvent"`
}
type CalendarEventUpdated struct {
ServerID string `json:"serverId"`
CalendarEvent `json:"calendarEvent"`
}
type CalendarEventDeleted struct {
ServerID string `json:"serverId"`
CalendarEvent `json:"calendarEvent"`
}
type ForumTopicCreated struct {
ServerID string `json:"serverId"`
ForumTopic `json:"forumTopic"`
}
type ForumTopicUpdated struct {
ServerID string `json:"serverId"`
ForumTopic `json:"forumTopic"`
}
type ForumTopicDeleted struct {
ServerID string `json:"serverId"`
ForumTopic `json:"forumTopic"`
}
type ForumTopicPinned struct {
ServerID string `json:"serverId"`
ForumTopic `json:"forumTopic"`
}
type ForumTopicUnpinned struct {
ServerID string `json:"serverId"`
ForumTopic `json:"forumTopic"`
}
type ForumTopicReactionCreated struct {
ServerID string `json:"serverId"`
Reaction struct {
ChannelID string `json:"channelId"`
CreatedBy string `json:"createdBy"`
Emote `json:"emote"`
ForumTopicID int `json:"forumTopicId"`
}
}
type ForumTopicReactionDeleted struct {
ServerID string `json:"serverId"`
Reaction struct {
ChannelID string `json:"channelId"`
CreatedBy string `json:"createdBy"`
Emote `json:"emote"`
ForumTopicID int `json:"forumTopicId"`
}
}
type ForumTopicLocked struct {
ServerID string `json:"serverId"`
ForumTopic `json:"forumTopic"`
}
type ForumTopicUnlocked struct {
ServerID string `json:"serverId"`
ForumTopic `json:"forumTopic"`
}
type ForumTopicCommentCreated struct {
ServerID string `json:"serverId"`
ForumTopicComment `json:"forumTopicComment"`
}
type ForumTopicCommentUpdated struct {
ServerID string `json:"serverId"`
ForumTopicComment `json:"forumTopicComment"`
}
type ForumTopicCommentDeleted struct {
ServerID string `json:"serverId"`
ForumTopicComment `json:"forumTopicComment"`
}
type ChannelArchived struct {
ServerID string `json:"serverId"`
Channel ServerChannel `json:"channel"`
}
type ChannelRestored struct {
ServerID string `json:"serverId"`
Channel ServerChannel `json:"channel"`
}