@@ -128,6 +128,28 @@ type Session struct {
128
128
wsMutex sync.Mutex
129
129
}
130
130
131
+ // Application stores values for a Discord Application
132
+ type Application struct {
133
+ ID string `json:"id,omitempty"`
134
+ Name string `json:"name"`
135
+ Icon string `json:"icon,omitempty"`
136
+ Description string `json:"description,omitempty"`
137
+ RPCOrigins []string `json:"rpc_origins,omitempty"`
138
+ BotPublic bool `json:"bot_public,omitempty"`
139
+ BotRequireCodeGrant bool `json:"bot_require_code_grant,omitempty"`
140
+ TermsOfServiceURL string `json:"terms_of_service_url"`
141
+ PrivacyProxyURL string `json:"privacy_policy_url"`
142
+ Owner * User `json:"owner"`
143
+ Summary string `json:"summary"`
144
+ VerifyKey string `json:"verify_key"`
145
+ Team * Team `json:"team"`
146
+ GuildID string `json:"guild_id"`
147
+ PrimarySKUID string `json:"primary_sku_id"`
148
+ Slug string `json:"slug"`
149
+ CoverImage string `json:"cover_image"`
150
+ Flags int `json:"flags,omitempty"`
151
+ }
152
+
131
153
// UserConnection is a Connection returned from the UserConnections endpoint
132
154
type UserConnection struct {
133
155
ID string `json:"id"`
@@ -191,36 +213,38 @@ type ICEServer struct {
191
213
Credential string `json:"credential"`
192
214
}
193
215
216
+ // InviteTargetType indicates the type of target of an invite
217
+ // https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
218
+ type InviteTargetType uint8
219
+
220
+ // Invite target types
221
+ const (
222
+ InviteTargetStream InviteTargetType = 1
223
+ InviteTargetEmbeddedAppliction InviteTargetType = 2
224
+ )
225
+
194
226
// A Invite stores all data related to a specific Discord Guild or Channel invite.
195
227
type Invite struct {
196
- Guild * Guild `json:"guild"`
197
- Channel * Channel `json:"channel"`
198
- Inviter * User `json:"inviter"`
199
- Code string `json:"code"`
200
- CreatedAt time.Time `json:"created_at"`
201
- MaxAge int `json:"max_age"`
202
- Uses int `json:"uses"`
203
- MaxUses int `json:"max_uses"`
204
- Revoked bool `json:"revoked"`
205
- Temporary bool `json:"temporary"`
206
- Unique bool `json:"unique"`
207
- TargetUser * User `json:"target_user"`
208
- TargetUserType TargetUserType `json:"target_user_type"`
228
+ Guild * Guild `json:"guild"`
229
+ Channel * Channel `json:"channel"`
230
+ Inviter * User `json:"inviter"`
231
+ Code string `json:"code"`
232
+ CreatedAt time.Time `json:"created_at"`
233
+ MaxAge int `json:"max_age"`
234
+ Uses int `json:"uses"`
235
+ MaxUses int `json:"max_uses"`
236
+ Revoked bool `json:"revoked"`
237
+ Temporary bool `json:"temporary"`
238
+ Unique bool `json:"unique"`
239
+ TargetUser * User `json:"target_user"`
240
+ TargetType InviteTargetType `json:"target_type"`
241
+ TargetApplication * Application `json:"target_application"`
209
242
210
243
// will only be filled when using InviteWithCounts
211
244
ApproximatePresenceCount int `json:"approximate_presence_count"`
212
245
ApproximateMemberCount int `json:"approximate_member_count"`
213
246
}
214
247
215
- // TargetUserType is the type of the target user
216
- // https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
217
- type TargetUserType int
218
-
219
- // Block contains known TargetUserType values
220
- const (
221
- TargetUserTypeStream TargetUserType = 1
222
- )
223
-
224
248
// ChannelType is the type of a Channel
225
249
type ChannelType int
226
250
0 commit comments