forked from amatsagu/tempest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponse.go
56 lines (48 loc) · 2.32 KB
/
response.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
package tempest
// https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
type ResponseType uint8
const (
PONG_RESPONSE_TYPE ResponseType = iota + 1
ACKNOWLEDGE_RESPONSE_TYPE
CHANNEL_MESSAGE_RESPONSE_TYPE
CHANNEL_MESSAGE_WITH_SOURCE_RESPONSE_TYPE
DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE_RESPONSE_TYPE
DEFERRED_UPDATE_MESSAGE_RESPONSE_TYPE // Only valid for component-based interactions.
UPDATE_MESSAGE_RESPONSE_TYPE // Only valid for component-based interactions.
AUTOCOMPLETE_RESPONSE_TYPE
MODAL_RESPONSE_TYPE // Not available for MODAL_SUBMIT and PING interactions.
)
// https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object
type ResponseMessage struct {
Type ResponseType `json:"type"`
Data *ResponseMessageData `json:"data,omitempty"`
}
// https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-messages
type ResponseMessageData struct {
TTS bool `json:"tts,omitempty"`
Content string `json:"content,omitempty"`
Embeds []*Embed `json:"embeds,omitempty"`
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
Flags uint64 `json:"flags,omitempty"`
Components []*ComponentRow `json:"components,omitempty"`
}
// https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object
type ResponseAutoComplete struct {
Type ResponseType `json:"type"`
Data *ResponseAutoCompleteData `json:"data,omitempty"`
}
// https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-autocomplete
type ResponseAutoCompleteData struct {
Choices []Choice `json:"choices,omitempty"`
}
// https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object
type ResponseModal struct {
Type ResponseType `json:"type"`
Data *ResponseModalData `json:"data,omitempty"`
}
// https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal
type ResponseModalData struct {
CustomID string `json:"custom_id"`
Title string `json:"title"`
Components []*ComponentRow `json:"components,omitempty"`
}