-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoints_http.go
287 lines (264 loc) · 10.9 KB
/
endpoints_http.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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
package discord
// Endpoints.
var (
EndpointDiscord = "https://discord.com"
EndpointCDN = "https://cdn.discordapp.com"
EndpointGuilds = "/guilds/"
EndpointChannels = "/channels/"
EndpointUsers = "/users/"
EndpointGateway = "/gateway"
EndpointGatewayBot = EndpointGateway + "/bot"
EndpointWebhooks = "/webhooks/"
EndpointCDNAttachments = "/attachments/"
EndpointCDNAvatars = "/avatars/"
EndpointCDNIcons = "/icons/"
EndpointCDNSplashes = "/splashes/"
EndpointCDNChannelIcons = "/channel-icons/"
EndpointCDNBanners = "/banners/"
EndpointUser = func(userID string) string {
return EndpointUsers + userID
}
EndpointUserAvatar = func(userID string, avatarID string) string {
return EndpointCDNAvatars + userID + "/" + avatarID + ".png"
}
EndpointUserAvatarAnimated = func(userID string, avatarID string) string {
return EndpointCDNAvatars + userID + "/" + avatarID + ".gif"
}
EndpointDefaultUserAvatar = func(index string) string {
return "/embed/avatars/" + index + ".png"
}
EndpointUserGuilds = func(userID string) string {
return EndpointUsers + userID + "/guilds"
}
EndpointUserGuild = func(userID, guildID string) string {
return EndpointUsers + userID + "/guilds/" + guildID
}
EndpointUserGuildMember = func(userID, guildID string) string {
return EndpointUserGuild(userID, guildID) + "/member"
}
EndpointUserChannels = func(userID string) string {
return EndpointUsers + userID + "/channels"
}
EndpointGuild = func(guildID string) string {
return EndpointGuilds + guildID
}
EndpointGuildVanityURL = func(guildID string) string {
return EndpointGuilds + guildID + "/vanity-url"
}
EndpointGuildPreview = func(guildID string) string {
return EndpointGuilds + guildID + "/preview"
}
EndpointGuildChannels = func(guildID string) string {
return EndpointGuilds + guildID + "/channels"
}
EndpointGuildMembers = func(guildID string) string {
return EndpointGuilds + guildID + "/members"
}
EndpointGuildMembersSearch = func(guildID string) string {
return EndpointGuildMembers(guildID) + "/search"
}
EndpointGuildMember = func(guildID, userID string) string {
return EndpointGuilds + guildID + "/members/" + userID
}
EndpointGuildMemberRole = func(guildID, userID, roleID string) string {
return EndpointGuilds + guildID + "/members/" + userID + "/roles/" + roleID
}
EndpointGuildBans = func(guildID string) string {
return EndpointGuilds + guildID + "/bans"
}
EndpointGuildBan = func(guildID, userID string) string {
return EndpointGuilds + guildID + "/bans/" + userID
}
EndpointGuildIntegrations = func(guildID string) string {
return EndpointGuilds + guildID + "/integrations"
}
EndpointGuildIntegration = func(guildID, integrationID string) string {
return EndpointGuilds + guildID + "/integrations/" + integrationID
}
EndpointGuildIntegrationSync = func(guildID, integrationID string) string {
return EndpointGuilds + guildID + "/integrations/" + integrationID + "/sync"
}
EndpointGuildRoles = func(guildID string) string {
return EndpointGuilds + guildID + "/roles"
}
EndpointGuildRole = func(guildID, roleID string) string {
return EndpointGuilds + guildID + "/roles/" + roleID
}
EndpointGuildInvites = func(guildID string) string {
return EndpointGuilds + guildID + "/invites"
}
EndpointGuildWidget = func(guildID string) string {
return EndpointGuilds + guildID + "/widget"
}
EndpointGuildEmbed = EndpointGuildWidget
EndpointGuildPrune = func(guildID string) string {
return EndpointGuilds + guildID + "/prune"
}
EndpointGuildIcon = func(guildID string, hash string) string {
return EndpointCDNIcons + guildID + "/" + hash + ".png"
}
EndpointGuildIconAnimated = func(guildID string, hash string) string {
return EndpointCDNIcons + guildID + "/" + hash + ".gif"
}
EndpointGuildSplash = func(guildID string, hash string) string {
return EndpointCDNSplashes + guildID + "/" + hash + ".png"
}
EndpointGuildWebhooks = func(guildID string) string {
return EndpointGuilds + guildID + "/webhooks"
}
EndpointGuildAuditLogs = func(guildID string) string {
return EndpointGuilds + guildID + "/audit-logs"
}
EndpointGuildEmojis = func(guildID string) string {
return EndpointGuilds + guildID + "/emojis"
}
EndpointGuildEmoji = func(guildID, emojiID string) string {
return EndpointGuilds + guildID + "/emojis/" + emojiID
}
EndpointGuildBanner = func(guildID string, hash string) string {
return EndpointCDNBanners + guildID + "/" + hash + ".png"
}
EndpointGuildScheduledEvents = func(guildID string) string {
return EndpointGuilds + guildID + "/scheduled-events"
}
EndpointGuildScheduledEvent = func(guildID, eventID string) string {
return EndpointGuilds + guildID + "/scheduled-events/" + eventID
}
EndpointGuildScheduledEventUsers = func(guildID, eventID string) string {
return EndpointGuildScheduledEvent(guildID, eventID) + "/users"
}
EndpointChannel = func(channelID string) string {
return EndpointChannels + channelID
}
EndpointChannelPermissions = func(channelID string) string {
return EndpointChannels + channelID + "/permissions"
}
EndpointChannelPermission = func(channelID, overwriteID string) string {
return EndpointChannels + channelID + "/permissions/" + overwriteID
}
EndpointChannelInvites = func(channelID string) string {
return EndpointChannels + channelID + "/invites"
}
EndpointChannelTyping = func(channelID string) string {
return EndpointChannels + channelID + "/typing"
}
EndpointChannelMessages = func(channelID string) string {
return EndpointChannels + channelID + "/messages"
}
EndpointChannelMessage = func(channelID, messageID string) string {
return EndpointChannels + channelID + "/messages/" + messageID
}
EndpointChannelMessageAck = func(channelID, messageID string) string {
return EndpointChannels + channelID + "/messages/" + messageID + "/ack"
}
EndpointChannelMessagesBulkDelete = func(channelID string) string {
return EndpointChannel(channelID) + "/messages/bulk-delete"
}
EndpointChannelMessagesPins = func(channelID string) string {
return EndpointChannel(channelID) + "/pins"
}
EndpointChannelMessagePin = func(channelID, messageID string) string {
return EndpointChannel(channelID) + "/pins/" + messageID
}
EndpointChannelMessageCrosspost = func(channelID, messageID string) string {
return EndpointChannel(channelID) + "/messages/" + messageID + "/crosspost"
}
EndpointChannelFollow = func(channelID string) string {
return EndpointChannel(channelID) + "/followers"
}
EndpointGroupIcon = func(channelID string, hash string) string {
return EndpointCDNChannelIcons + channelID + "/" + hash + ".png"
}
EndpointChannelWebhooks = func(channelID string) string {
return EndpointChannel(channelID) + "/webhooks"
}
EndpointWebhook = func(webhookID string) string {
return EndpointWebhooks + webhookID
}
EndpointWebhookToken = func(webhookID string, token string) string {
return EndpointWebhooks + webhookID + "/" + token
}
EndpointWebhookMessage = func(webhookID string, token string, messageID string) string {
return EndpointWebhookToken(webhookID, token) + "/messages/" + messageID
}
EndpointMessageReactionsAll = func(channelID, messageID string) string {
return EndpointChannelMessage(channelID, messageID) + "/reactions"
}
EndpointMessageReactions = func(channelID, messageID, emojiID string) string {
return EndpointChannelMessage(channelID, messageID) + "/reactions/" + emojiID
}
EndpointMessageReaction = func(channelID, messageID, emojiID, targetID string) string {
return EndpointMessageReactions(channelID, messageID, emojiID) + "/" + targetID
}
EndpointApplicationGlobalCommands = func(applicationID string) string {
return EndpointApplication(applicationID) + "/commands"
}
EndpointApplicationGlobalCommand = func(applicationID, channelID string) string {
return EndpointApplicationGlobalCommands(applicationID) + "/" + channelID
}
EndpointApplicationGuildCommands = func(applicationID, guildID string) string {
return EndpointApplication(applicationID) + "/guilds/" + guildID + "/commands"
}
EndpointApplicationGuildCommandsPermissions = func(applicationID, guildID string) string {
return EndpointApplication(applicationID) + "/guilds/" + guildID + "/commands/permissions"
}
EndpointApplicationGuildCommand = func(applicationID, guildID, commandID string) string {
return EndpointApplicationGuildCommands(applicationID, guildID) + "/" + commandID
}
EndpointApplicationGuildCommandPermissions = func(applicationID, guildID, commandID string) string {
return EndpointApplicationGuildCommands(applicationID, guildID) + "/" + commandID + "/permissions"
}
EndpointInteraction = func(applicationID string, interactionToken string) string {
return "/interactions/" + applicationID + "/" + interactionToken
}
EndpointInteractionResponse = func(interactionID string, interactionToken string) string {
return EndpointInteraction(interactionID, interactionToken) + "/callback"
}
EndpointInteractionResponseActions = func(applicationID string, interactionToken string) string {
return EndpointWebhookMessage(applicationID, interactionToken, "@original")
}
EndpointFollowupMessage = func(applicationID string, interactionToken string) string {
return EndpointWebhookToken(applicationID, interactionToken)
}
EndpointFollowupMessageActions = func(applicationID string, interactionToken string, messageID string) string {
return EndpointWebhookMessage(applicationID, interactionToken, messageID)
}
EndpointGuildCreate = "/guilds"
EndpointInvite = func(inviteID string) string {
return "/invites/" + inviteID
}
EndpointIntegrationsJoin = func(interactionID string) string {
return "/integrations/" + interactionID + "/join"
}
EndpointEmoji = func(emojiID string) string {
return "/emojis/" + emojiID + ".png"
}
EndpointEmojiAnimated = func(emojiID string) string {
return "/emojis/" + emojiID + ".gif"
}
EndpointApplications = "/applications"
EndpointApplication = func(applicationID string) string {
return EndpointApplications + "/" + applicationID
}
EndpointEntitlements = func(applicationID string) string {
return EndpointApplication(applicationID) + "/entitlements"
}
EndpointEntitlement = func(applicationID, entitlementID string) string {
return EndpointEntitlements(applicationID) + "/" + entitlementID
}
EndpointOAuth2 = "/oauth2"
EndpointOAuth2Me = EndpointOAuth2 + "/@me"
EndpointOAuth2Applications = EndpointOAuth2 + "/applications"
EndpointOAuth2Authorize = EndpointOAuth2 + "/authorize"
EndpointOAuth2Token = EndpointOAuth2 + "/token"
EndpointOAuth2TokenRevoke = EndpointOAuth2Token + "/revoke"
EndpointOAuth2Application = func(applicationID string) string {
return EndpointOAuth2Applications + "/" + applicationID
}
EndpointOAuth2ApplicationsBot = func(applicationID string) string {
return EndpointOAuth2Applications + "/" + applicationID + "/bot"
}
EndpointOAuth2ApplicationAssets = func(applicationID string) string {
return EndpointOAuth2Applications + "/" + applicationID + "/assets"
}
)