Skip to content

Commit 0df3fba

Browse files
author
caneleex
committed
add IntegrationExpireBehavior type
1 parent cecb1a6 commit 0df3fba

File tree

2 files changed

+33
-26
lines changed

2 files changed

+33
-26
lines changed

discord/audit_log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ type AuditLogChangeKey struct {
230230
ID *snowflake.ID `json:"id"`
231231
Type any `json:"type"`
232232
EnableEmoticons *bool `json:"enable_emoticons"`
233-
ExpireBehavior *int `json:"expire_behavior"`
233+
ExpireBehavior *IntegrationExpireBehavior `json:"expire_behavior"`
234234
ExpireGracePeriod *int `json:"expire_grace_period"`
235235
UserLimit *int `json:"user_limit"`
236236
PrivacyLevel *StagePrivacyLevel `json:"privacy_level"`

discord/integration.go

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,19 @@ func (i *UnmarshalIntegration) UnmarshalJSON(data []byte) error {
8989
}
9090

9191
type TwitchIntegration struct {
92-
IntegrationID snowflake.ID `json:"id"`
93-
Name string `json:"name"`
94-
Enabled bool `json:"enabled"`
95-
Syncing bool `json:"syncing"`
96-
RoleID snowflake.ID `json:"role_id"`
97-
EnableEmoticons bool `json:"enable_emoticons"`
98-
ExpireBehavior int `json:"expire_behavior"`
99-
ExpireGracePeriod int `json:"expire_grace_period"`
100-
User User `json:"user"`
101-
Account IntegrationAccount `json:"account"`
102-
SyncedAt string `json:"synced_at"`
103-
SubscriberCount int `json:"subscriber_account"`
104-
Revoked bool `json:"revoked"`
92+
IntegrationID snowflake.ID `json:"id"`
93+
Name string `json:"name"`
94+
Enabled bool `json:"enabled"`
95+
Syncing bool `json:"syncing"`
96+
RoleID snowflake.ID `json:"role_id"`
97+
EnableEmoticons bool `json:"enable_emoticons"`
98+
ExpireBehavior IntegrationExpireBehavior `json:"expire_behavior"`
99+
ExpireGracePeriod int `json:"expire_grace_period"`
100+
User User `json:"user"`
101+
Account IntegrationAccount `json:"account"`
102+
SyncedAt string `json:"synced_at"`
103+
SubscriberCount int `json:"subscriber_account"`
104+
Revoked bool `json:"revoked"`
105105
}
106106

107107
func (i TwitchIntegration) MarshalJSON() ([]byte, error) {
@@ -128,18 +128,18 @@ func (i TwitchIntegration) CreatedAt() time.Time {
128128
}
129129

130130
type YouTubeIntegration struct {
131-
IntegrationID snowflake.ID `json:"id"`
132-
Name string `json:"name"`
133-
Enabled bool `json:"enabled"`
134-
Syncing bool `json:"syncing"`
135-
RoleID snowflake.ID `json:"role_id"`
136-
ExpireBehavior int `json:"expire_behavior"`
137-
ExpireGracePeriod int `json:"expire_grace_period"`
138-
User User `json:"user"`
139-
Account IntegrationAccount `json:"account"`
140-
SyncedAt string `json:"synced_at"`
141-
SubscriberCount int `json:"subscriber_account"`
142-
Revoked bool `json:"revoked"`
131+
IntegrationID snowflake.ID `json:"id"`
132+
Name string `json:"name"`
133+
Enabled bool `json:"enabled"`
134+
Syncing bool `json:"syncing"`
135+
RoleID snowflake.ID `json:"role_id"`
136+
ExpireBehavior IntegrationExpireBehavior `json:"expire_behavior"`
137+
ExpireGracePeriod int `json:"expire_grace_period"`
138+
User User `json:"user"`
139+
Account IntegrationAccount `json:"account"`
140+
SyncedAt string `json:"synced_at"`
141+
SubscriberCount int `json:"subscriber_account"`
142+
Revoked bool `json:"revoked"`
143143
}
144144

145145
func (i YouTubeIntegration) MarshalJSON() ([]byte, error) {
@@ -165,6 +165,13 @@ func (i YouTubeIntegration) CreatedAt() time.Time {
165165
return i.IntegrationID.Time()
166166
}
167167

168+
type IntegrationExpireBehavior int
169+
170+
const (
171+
IntegrationExpireBehaviorRemoveRole IntegrationExpireBehavior = iota
172+
IntegrationExpireBehaviorKick
173+
)
174+
168175
type BotIntegration struct {
169176
IntegrationID snowflake.ID `json:"id"`
170177
Name string `json:"name"`

0 commit comments

Comments
 (0)