|
| 1 | +package api |
| 2 | + |
| 3 | +// AuditLogChangeKey (https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-key) is data representing changes values/settings in an audit log. |
| 4 | +type AuditLogChangeKey struct { |
| 5 | + Name *string `json:"name"` |
| 6 | + Description *string `json:"description"` |
| 7 | + IconHash *string `json:"icon_hash"` |
| 8 | + SplashHash *string `json:"splash_hash"` |
| 9 | + DiscoverySplashHash *string `json:"discovery_splash_hash"` |
| 10 | + BannerHash *string `json:"banner_hash"` |
| 11 | + OwnerID *Snowflake `json:"owner_id"` |
| 12 | + Region *string `json:"region"` |
| 13 | + PreferredLocale *string `json:"preferred_locale"` |
| 14 | + AFKChannelID *Snowflake `json:"afk_channel_id"` |
| 15 | + AFKTimeout *int `json:"afk_timeout"` |
| 16 | + RulesChannelID *Snowflake `json:"rules_channel_id"` |
| 17 | + PublicUpdatesChannelID *Snowflake `json:"public_updates_channel_id"` |
| 18 | + MFALevel *MFALevel `json:"mfa_level"` |
| 19 | + VerificationLevel *VerificationLevel `json:"verification_level"` |
| 20 | + ExplicitContentFilterLevel *ExplicitContentFilterLevel `json:"explicit_content_filter"` |
| 21 | + DefaultMessageNotifications *MessageNotifications `json:"default_message_notifications"` |
| 22 | + VanityURLCode *string `json:"vanity_url_code"` |
| 23 | + Add []Role `json:"$add"` |
| 24 | + Remove []Role `json:"$remove"` |
| 25 | + PruneDeleteDays *int `json:"prune_delete_days"` |
| 26 | + WidgetEnabled *bool `json:"widget_enabled"` |
| 27 | + WidgetChannelID *string `json:"widget_channel_id"` |
| 28 | + SystemChannelID *string `json:"system_channel_id"` |
| 29 | + Position *int `json:"position"` |
| 30 | + Topic *string `json:"topic"` |
| 31 | + Bitrate *int `json:"bitrate"` |
| 32 | + PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites"` |
| 33 | + NSFW *bool `json:"nsfw"` |
| 34 | + ApplicationID *Snowflake `json:"application_id"` |
| 35 | + RateLimitPerUser *int `json:"ratelimit_per_user"` |
| 36 | + Permissions *string `json:"permissions"` |
| 37 | + Color *int `json:"color"` |
| 38 | + Hoist *bool `json:"hoist"` |
| 39 | + Mentionable *bool `json:"mentionable"` |
| 40 | + Allow *Permissions `json:"allow"` |
| 41 | + Deny *Permissions `json:"deny"` |
| 42 | + Code *string `json:"code"` |
| 43 | + ChannelID *Snowflake `json:"channel_id"` |
| 44 | + InviterID *Snowflake `json:"inviter_id"` |
| 45 | + MaxUses *int `json:"max_uses"` |
| 46 | + Uses *int `json:"uses"` |
| 47 | + MaxAge *string `json:"max_age"` |
| 48 | + Temporary *bool `json:"temporary"` |
| 49 | + Deaf *bool `json:"deaf"` |
| 50 | + Mute *bool `json:"mute"` |
| 51 | + Nick *string `json:"nick"` |
| 52 | + AvatarHash *string `json:"avatar_hash"` |
| 53 | + ID *Snowflake `json:"id"` |
| 54 | + Type interface{} `json:"type"` |
| 55 | + EnableEmoticons *bool `json:"enable_emoticons"` |
| 56 | + ExpireBehavior *int `json:"expire_behavior"` |
| 57 | + ExpireGracePeriod *int `json:"expire_grace_period"` |
| 58 | + UserLimit *int `json:"user_limit"` |
| 59 | + PrivacyLevel *int `json:"privacy_level"` |
| 60 | +} |
| 61 | + |
| 62 | +// AuditLogEvent is an 8-bit unsigned integer representing an audit log event. |
| 63 | +type AuditLogEvent int |
| 64 | + |
| 65 | +// AuditLogEventGuildUpdate |
| 66 | +const ( |
| 67 | + AuditLogEventGuildUpdate AuditLogEvent = 1 |
| 68 | +) |
| 69 | + |
| 70 | +// AuditLogEventChannelCreate |
| 71 | +const ( |
| 72 | + AuditLogEventChannelCreate AuditLogEvent = iota + 10 |
| 73 | + AuditLogEventChannelUpdate |
| 74 | + AuditLogEventChannelDelete |
| 75 | + AuditLogEventChannelOverwriteCreate |
| 76 | + AuditLogEventChannelOverwriteUpdate |
| 77 | + AuditLogEventChannelOverwriteDelete |
| 78 | +) |
| 79 | + |
| 80 | +// AuditLogEventMemberKick |
| 81 | +const ( |
| 82 | + AuditLogEventMemberKick AuditLogEvent = iota + 20 |
| 83 | + AuditLogEventMemberPrune |
| 84 | + AuditLogEventMemberBanAdd |
| 85 | + AuditLogEventMemberBanRemove |
| 86 | + AuditLogEventMemberUpdate |
| 87 | + AuditLogEventMemberRoleUpdate |
| 88 | + AuditLogEventMemberMove |
| 89 | + AuditLogEventMemberDisconnect |
| 90 | + AuditLogEventBotAdd |
| 91 | +) |
| 92 | + |
| 93 | +// AuditLogEventRoleCreate |
| 94 | +const ( |
| 95 | + AuditLogEventRoleCreate AuditLogEvent = iota + 30 |
| 96 | + AuditLogEventRoleUpdate |
| 97 | + AuditLogEventRoleDelete |
| 98 | +) |
| 99 | + |
| 100 | +// AuditLogEventInviteCreate |
| 101 | +const ( |
| 102 | + AuditLogEventInviteCreate AuditLogEvent = iota + 40 |
| 103 | + AuditLogEventInviteUpdate |
| 104 | + AuditLogEventInviteDelete |
| 105 | +) |
| 106 | + |
| 107 | +// AuditLogEventWebhookCreate |
| 108 | +const ( |
| 109 | + AuditLogEventWebhookCreate AuditLogEvent = iota + 50 |
| 110 | + AuditLogEventWebhookUpdate |
| 111 | + AuditLogEventWebhookDelete |
| 112 | +) |
| 113 | + |
| 114 | +// AuditLogEventEmojiCreate |
| 115 | +const ( |
| 116 | + AuditLogEventEmojiCreate AuditLogEvent = iota + 60 |
| 117 | + AuditLogEventEmojiUpdate |
| 118 | + AuditLogEventEmojiDelete |
| 119 | +) |
| 120 | + |
| 121 | +// AuditLogEventMessageDelete |
| 122 | +const ( |
| 123 | + AuditLogEventMessageDelete AuditLogEvent = iota + 72 |
| 124 | + AuditLogEventMessageBulkDelete |
| 125 | + AuditLogEventMessagePin |
| 126 | + AuditLogEventMessageUnpin |
| 127 | +) |
| 128 | + |
| 129 | +// AuditLogEventIntegrationCreate |
| 130 | +const ( |
| 131 | + AuditLogEventIntegrationCreate AuditLogEvent = iota + 80 |
| 132 | + AuditLogEventIntegrationUpdate |
| 133 | + AuditLogEventIntegrationDelete |
| 134 | + AuditLogEventStageInstanceCreate |
| 135 | + AuditLogEventStageInstanceUpdate |
| 136 | + AuditLogEventStageInstanceDelete |
| 137 | +) |
| 138 | + |
| 139 | +// OptionalAuditLogEntryInfo (https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info) |
| 140 | +type OptionalAuditLogEntryInfo struct { |
| 141 | + DeleteMemberDays *string `json:"delete_member_days"` |
| 142 | + MembersRemoved *string `json:"members_removed"` |
| 143 | + ChannelID *Snowflake `json:"channel_id"` |
| 144 | + MessageID *Snowflake `json:"message_id"` |
| 145 | + Count *string `json:"count"` |
| 146 | + ID *string `json:"id"` |
| 147 | + Type *string `json:"type"` |
| 148 | + RoleName *string `json:"role_name"` |
| 149 | +} |
| 150 | + |
| 151 | +// AuditLogEntry (https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object) |
| 152 | +type AuditLogEntry struct { |
| 153 | + TargetID *Snowflake `json:"target_id"` |
| 154 | + Changes []AuditLogChangeKey `json:"changes"` |
| 155 | + UserID Snowflake `json:"user_id"` |
| 156 | + ID Snowflake `json:"id"` |
| 157 | + ActionType AuditLogEvent `json:"action_type"` |
| 158 | + Options *OptionalAuditLogEntryInfo `json:"options"` |
| 159 | + Reason *string `json:"reason"` |
| 160 | +} |
| 161 | + |
| 162 | +// AuditLog (https://discord.com/developers/docs/resources/audit-log) These are logs of events that occurred, accessible via the Discord API. |
| 163 | +type AuditLog struct { |
| 164 | + Webhooks []Webhook |
| 165 | + Users []User |
| 166 | + Entries []AuditLogEntry |
| 167 | + Integrations []Integration |
| 168 | +} |
0 commit comments