Updates API (#785)

* Update to API

Updates the golang stuct to current api documentation and adds new util

* Revert of change.

* Update message.go

* Update structs.go

* Yikes this my hand hurts.

* Consistency

* Update message.go
This commit is contained in:
TroyDota 2020-06-29 00:53:46 +02:00 committed by GitHub
parent 9c46cf4ec7
commit 9ce4a230c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 293 additions and 89 deletions

View file

@ -16,6 +16,7 @@ import (
) )
// MessageType is the type of Message // MessageType is the type of Message
// https://discord.com/developers/docs/resources/channel#message-object-message-types
type MessageType int type MessageType int
// Block contains the valid known MessageType values // Block contains the valid known MessageType values
@ -33,6 +34,8 @@ const (
MessageTypeUserPremiumGuildSubscriptionTierTwo MessageTypeUserPremiumGuildSubscriptionTierTwo
MessageTypeUserPremiumGuildSubscriptionTierThree MessageTypeUserPremiumGuildSubscriptionTierThree
MessageTypeChannelFollowAdd MessageTypeChannelFollowAdd
MessageTypeGuildDiscoveryDisqualified
MessageTypeGuildDiscoveryRequalified
) )
// A Message stores all data related to a specific Discord message. // A Message stores all data related to a specific Discord message.
@ -117,9 +120,22 @@ type Message struct {
// The flags of the message, which describe extra features of a message. // The flags of the message, which describe extra features of a message.
// This is a combination of bit masks; the presence of a certain permission can // This is a combination of bit masks; the presence of a certain permission can
// be checked by performing a bitwise AND between this int and the flag. // be checked by performing a bitwise AND between this int and the flag.
Flags int `json:"flags"` Flags MessageFlags `json:"flags"`
} }
// MessageFlags is the flags of "message" (see MessageFlags* consts)
// https://discord.com/developers/docs/resources/channel#message-object-message-flags
type MessageFlags int
// Valid MessageFlags values
const (
MessageFlagsCrossPosted MessageFlags = 1 << iota
MessageFlagsIsCrossPosted
MessageFlagsSupressEmbeds
MessageFlagsSourceMessageDeleted
MessageFlagsUrgent
)
// File stores info about files you e.g. send in messages. // File stores info about files you e.g. send in messages.
type File struct { type File struct {
Name string Name string
@ -246,7 +262,6 @@ type MessageEmbedThumbnail struct {
// MessageEmbedVideo is a part of a MessageEmbed struct. // MessageEmbedVideo is a part of a MessageEmbed struct.
type MessageEmbedVideo struct { type MessageEmbedVideo struct {
URL string `json:"url,omitempty"` URL string `json:"url,omitempty"`
ProxyURL string `json:"proxy_url,omitempty"`
Width int `json:"width,omitempty"` Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"` Height int `json:"height,omitempty"`
} }
@ -275,7 +290,7 @@ type MessageEmbedField struct {
// An MessageEmbed stores data for message embeds. // An MessageEmbed stores data for message embeds.
type MessageEmbed struct { type MessageEmbed struct {
URL string `json:"url,omitempty"` URL string `json:"url,omitempty"`
Type string `json:"type,omitempty"` Type EmbedType `json:"type,omitempty"`
Title string `json:"title,omitempty"` Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"` Description string `json:"description,omitempty"`
Timestamp string `json:"timestamp,omitempty"` Timestamp string `json:"timestamp,omitempty"`
@ -289,6 +304,20 @@ type MessageEmbed struct {
Fields []*MessageEmbedField `json:"fields,omitempty"` Fields []*MessageEmbedField `json:"fields,omitempty"`
} }
// EmbedType is the type of embed
// https://discord.com/developers/docs/resources/channel#embed-object-embed-types
type EmbedType string
// Block of valid EmbedTypes
const (
EmbedTypeRich EmbedType = "rich"
EmbedTypeImage EmbedType = "image"
EmbedTypeVideo EmbedType = "video"
EmbedTypeGifv EmbedType = "gifv"
EmbedTypeArticle EmbedType = "article"
EmbedTypeLink EmbedType = "link"
)
// MessageReactions holds a reactions object for a message. // MessageReactions holds a reactions object for a message.
type MessageReactions struct { type MessageReactions struct {
Count int `json:"count"` Count int `json:"count"`

View file

@ -143,13 +143,24 @@ type Integration struct {
Enabled bool `json:"enabled"` Enabled bool `json:"enabled"`
Syncing bool `json:"syncing"` Syncing bool `json:"syncing"`
RoleID string `json:"role_id"` RoleID string `json:"role_id"`
ExpireBehavior int `json:"expire_behavior"` EnableEmoticons bool `json:"enable_emoticons"`
ExpireBehavior ExpireBehavior `json:"expire_behavior"`
ExpireGracePeriod int `json:"expire_grace_period"` ExpireGracePeriod int `json:"expire_grace_period"`
User *User `json:"user"` User *User `json:"user"`
Account IntegrationAccount `json:"account"` Account IntegrationAccount `json:"account"`
SyncedAt Timestamp `json:"synced_at"` SyncedAt Timestamp `json:"synced_at"`
} }
//ExpireBehavior of Integration
// https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
type ExpireBehavior int
// Block of valid ExpireBehaviors
const (
ExpireBehaviorRemoveRole ExpireBehavior = iota
ExpireBehaviorKick
)
// IntegrationAccount is integration account information // IntegrationAccount is integration account information
// sent by the UserConnections endpoint // sent by the UserConnections endpoint
type IntegrationAccount struct { type IntegrationAccount struct {
@ -191,12 +202,23 @@ type Invite struct {
Revoked bool `json:"revoked"` Revoked bool `json:"revoked"`
Temporary bool `json:"temporary"` Temporary bool `json:"temporary"`
Unique bool `json:"unique"` Unique bool `json:"unique"`
TargetUser *User `json:"target_user"`
TargetUserType TargetUserType `json:"target_user_type"`
// will only be filled when using InviteWithCounts // will only be filled when using InviteWithCounts
ApproximatePresenceCount int `json:"approximate_presence_count"` ApproximatePresenceCount int `json:"approximate_presence_count"`
ApproximateMemberCount int `json:"approximate_member_count"` ApproximateMemberCount int `json:"approximate_member_count"`
} }
// TargetUserType is the type of the target user
// https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
type TargetUserType int
// Block contains known TargetUserType values
const (
TargetUserTypeStream TargetUserType = iota
)
// ChannelType is the type of a Channel // ChannelType is the type of a Channel
type ChannelType int type ChannelType int
@ -268,6 +290,12 @@ type Channel struct {
// Amount of seconds a user has to wait before sending another message (0-21600) // Amount of seconds a user has to wait before sending another message (0-21600)
// bots, as well as users with the permission manage_messages or manage_channel, are unaffected // bots, as well as users with the permission manage_messages or manage_channel, are unaffected
RateLimitPerUser int `json:"rate_limit_per_user"` RateLimitPerUser int `json:"rate_limit_per_user"`
// ID of the DM creator Zeroed if guild channel
OwnerID string `json:"owner_id"`
// ApplicationID of the DM creator Zeroed if guild channel or not a bot user
ApplicationID string `json:"application_id"`
} }
// Mention returns a string which mentions the channel // Mention returns a string which mentions the channel
@ -301,6 +329,7 @@ type Emoji struct {
ID string `json:"id"` ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Roles []string `json:"roles"` Roles []string `json:"roles"`
User *User `json:"user"`
Managed bool `json:"managed"` Managed bool `json:"managed"`
RequireColons bool `json:"require_colons"` RequireColons bool `json:"require_colons"`
Animated bool `json:"animated"` Animated bool `json:"animated"`
@ -398,11 +427,17 @@ type Guild struct {
// The user ID of the owner of the guild. // The user ID of the owner of the guild.
OwnerID string `json:"owner_id"` OwnerID string `json:"owner_id"`
// If we are the owner of the guild
Owner bool `json:"owner"`
// The time at which the current user joined the guild. // The time at which the current user joined the guild.
// This field is only present in GUILD_CREATE events and websocket // This field is only present in GUILD_CREATE events and websocket
// update events, and thus is only present in state-cached guilds. // update events, and thus is only present in state-cached guilds.
JoinedAt Timestamp `json:"joined_at"` JoinedAt Timestamp `json:"joined_at"`
// The hash of the guild's discovery splash.
DiscoverySplash string `json:"discovery_splash"`
// The hash of the guild's splash. // The hash of the guild's splash.
Splash string `json:"splash"` Splash string `json:"splash"`
@ -426,8 +461,7 @@ type Guild struct {
Large bool `json:"large"` Large bool `json:"large"`
// The default message notification setting for the guild. // The default message notification setting for the guild.
// 0 == all messages, 1 == mentions only. DefaultMessageNotifications MessageNotifications `json:"default_message_notifications"`
DefaultMessageNotifications int `json:"default_message_notifications"`
// A list of roles in the guild. // A list of roles in the guild.
Roles []*Role `json:"roles"` Roles []*Role `json:"roles"`
@ -445,6 +479,12 @@ type Guild struct {
// update events, and thus is only present in state-cached guilds. // update events, and thus is only present in state-cached guilds.
Presences []*Presence `json:"presences"` Presences []*Presence `json:"presences"`
// The maximum number of presences for the guild (the default value, currently 25000, is in effect when null is returned)
MaxPresences int `json:"max_presences"`
// The maximum number of members for the guild
MaxMembers int `json:"max_members"`
// A list of channels in the guild. // A list of channels in the guild.
// This field is only present in GUILD_CREATE events and websocket // This field is only present in GUILD_CREATE events and websocket
// update events, and thus is only present in state-cached guilds. // update events, and thus is only present in state-cached guilds.
@ -469,6 +509,9 @@ type Guild struct {
// Required MFA level for the guild // Required MFA level for the guild
MfaLevel MfaLevel `json:"mfa_level"` MfaLevel MfaLevel `json:"mfa_level"`
// The application id of the guild if bot created.
ApplicationID string `json:"application_id"`
// Whether or not the Server Widget is enabled // Whether or not the Server Widget is enabled
WidgetEnabled bool `json:"widget_enabled"` WidgetEnabled bool `json:"widget_enabled"`
@ -478,6 +521,12 @@ type Guild struct {
// The Channel ID to which system messages are sent (eg join and leave messages) // The Channel ID to which system messages are sent (eg join and leave messages)
SystemChannelID string `json:"system_channel_id"` SystemChannelID string `json:"system_channel_id"`
// The System channel flags
SystemChannelFlags SystemChannelFlag `json:"system_channel_flags"`
// The ID of the rules channel ID, used for rules.
RulesChannelID string `json:"rules_channel_id"`
// the vanity url code for the guild // the vanity url code for the guild
VanityURLCode string `json:"vanity_url_code"` VanityURLCode string `json:"vanity_url_code"`
@ -492,8 +541,46 @@ type Guild struct {
// The total number of users currently boosting this server // The total number of users currently boosting this server
PremiumSubscriptionCount int `json:"premium_subscription_count"` PremiumSubscriptionCount int `json:"premium_subscription_count"`
// The preferred locale of a guild with the "PUBLIC" feature; used in server discovery and notices from Discord; defaults to "en-US"
PreferredLocale string `json:"preferred_locale"`
// The id of the channel where admins and moderators of guilds with the "PUBLIC" feature receive notices from Discord
PublicUpdatesChannelID string `json:"public_updates_channel_id"`
// The maximum amount of users in a video channel
MaxVideoChannelUsers int `json:"max_video_channel_users"`
// Approximate number of members in this guild, returned from the GET /guild/<id> endpoint when with_counts is true
ApproximateMemberCount int `json:"approximate_member_count"`
// Approximate number of non-offline members in this guild, returned from the GET /guild/<id> endpoint when with_counts is true
ApproximatePresenceCount int `json:"approximate_presence_count"`
// Permissions of our user
Permissions int `json:"permissions"`
} }
// MessageNotifications is the notification level for a guild
// https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
type MessageNotifications int
// Block containing known MessageNotifications values
const (
MessageNotificationsAllMessages MessageNotifications = iota
MessageNotificationsOnlyMentions
)
// SystemChannelFlag is the type of flags in the system channel (see SystemChannelFlag* consts)
// https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
type SystemChannelFlag int
// Block containing known SystemChannelFlag values
const (
SystemChannelFlagsSuppressJoin SystemChannelFlag = 1 << iota
SystemChannelFlagsSuppressPremium
)
// IconURL returns a URL to the guild's icon. // IconURL returns a URL to the guild's icon.
func (g *Guild) IconURL() string { func (g *Guild) IconURL() string {
if g.Icon == "" { if g.Icon == "" {
@ -775,79 +862,157 @@ type GuildEmbed struct {
} }
// A GuildAuditLog stores data for a guild audit log. // A GuildAuditLog stores data for a guild audit log.
// https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
type GuildAuditLog struct { type GuildAuditLog struct {
Webhooks []struct { Webhooks []*Webhook `json:"webhooks,omitempty"`
ChannelID string `json:"channel_id"` Users []*User `json:"users,omitempty"`
GuildID string `json:"guild_id"` AuditLogEntries []*AuditLogEntry `json:"audit_log_entries"`
ID string `json:"id"` Integrations []*Integration `json:"integrations"`
Avatar string `json:"avatar"` }
Name string `json:"name"`
} `json:"webhooks,omitempty"` // AuditLogEntry for a GuildAuditLog
Users []struct { // https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
Username string `json:"username"` type AuditLogEntry struct {
Discriminator string `json:"discriminator"`
Bot bool `json:"bot"`
ID string `json:"id"`
Avatar string `json:"avatar"`
} `json:"users,omitempty"`
AuditLogEntries []struct {
TargetID string `json:"target_id"` TargetID string `json:"target_id"`
Changes []struct { Changes []*AuditLogChange `json:"changes"`
NewValue interface{} `json:"new_value"`
OldValue interface{} `json:"old_value"`
Key string `json:"key"`
} `json:"changes,omitempty"`
UserID string `json:"user_id"` UserID string `json:"user_id"`
ID string `json:"id"` ID string `json:"id"`
ActionType int `json:"action_type"` ActionType *AuditLogAction `json:"action_type"`
Options struct { Options *AuditLogOptions `json:"options"`
DeleteMembersDay string `json:"delete_member_days"` Reason string `json:"reason"`
}
// AuditLogChange for an AuditLogEntry
type AuditLogChange struct {
NewValue interface{} `json:"new_value"`
OldValue interface{} `json:"old_value"`
Key *AuditLogChangeKey `json:"key"`
}
// AuditLogChangeKey value for AuditLogChange
// https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-key
type AuditLogChangeKey string
// Block of valid AuditLogChangeKey
const (
AuditLogChangeKeyName AuditLogChangeKey = "name"
AuditLogChangeKeyIconHash AuditLogChangeKey = "icon_hash"
AuditLogChangeKeySplashHash AuditLogChangeKey = "splash_hash"
AuditLogChangeKeyOwnerID AuditLogChangeKey = "owner_id"
AuditLogChangeKeyRegion AuditLogChangeKey = "region"
AuditLogChangeKeyAfkChannelID AuditLogChangeKey = "afk_channel_id"
AuditLogChangeKeyAfkTimeout AuditLogChangeKey = "afk_timeout"
AuditLogChangeKeyMfaLevel AuditLogChangeKey = "mfa_level"
AuditLogChangeKeyVerificationLevel AuditLogChangeKey = "verification_level"
AuditLogChangeKeyExplicitContentFilter AuditLogChangeKey = "explicit_content_filter"
AuditLogChangeKeyDefaultMessageNotification AuditLogChangeKey = "default_message_notifications"
AuditLogChangeKeyVanityURLCode AuditLogChangeKey = "vanity_url_code"
AuditLogChangeKeyRoleAdd AuditLogChangeKey = "$add"
AuditLogChangeKeyRoleRemove AuditLogChangeKey = "$remove"
AuditLogChangeKeyPruneDeleteDays AuditLogChangeKey = "prune_delete_days"
AuditLogChangeKeyWidgetEnabled AuditLogChangeKey = "widget_enabled"
AuditLogChangeKeyWidgetChannelID AuditLogChangeKey = "widget_channel_id"
AuditLogChangeKeySystemChannelID AuditLogChangeKey = "system_channel_id"
AuditLogChangeKeyPosition AuditLogChangeKey = "position"
AuditLogChangeKeyTopic AuditLogChangeKey = "topic"
AuditLogChangeKeyBitrate AuditLogChangeKey = "bitrate"
AuditLogChangeKeyPermissionOverwrite AuditLogChangeKey = "permission_overwrites"
AuditLogChangeKeyNSFW AuditLogChangeKey = "nsfw"
AuditLogChangeKeyApplicationID AuditLogChangeKey = "application_id"
AuditLogChangeKeyRateLimitPerUser AuditLogChangeKey = "rate_limit_per_user"
AuditLogChangeKeyPermissions AuditLogChangeKey = "permissions"
AuditLogChangeKeyColor AuditLogChangeKey = "color"
AuditLogChangeKeyHoist AuditLogChangeKey = "hoist"
AuditLogChangeKeyMentionable AuditLogChangeKey = "mentionable"
AuditLogChangeKeyAllow AuditLogChangeKey = "allow"
AuditLogChangeKeyDeny AuditLogChangeKey = "deny"
AuditLogChangeKeyCode AuditLogChangeKey = "code"
AuditLogChangeKeyChannelID AuditLogChangeKey = "channel_id"
AuditLogChangeKeyInviterID AuditLogChangeKey = "inviter_id"
AuditLogChangeKeyMaxUses AuditLogChangeKey = "max_uses"
AuditLogChangeKeyUses AuditLogChangeKey = "uses"
AuditLogChangeKeyMaxAge AuditLogChangeKey = "max_age"
AuditLogChangeKeyTempoary AuditLogChangeKey = "temporary"
AuditLogChangeKeyDeaf AuditLogChangeKey = "deaf"
AuditLogChangeKeyMute AuditLogChangeKey = "mute"
AuditLogChangeKeyNick AuditLogChangeKey = "nick"
AuditLogChangeKeyAvatarHash AuditLogChangeKey = "avatar_hash"
AuditLogChangeKeyID AuditLogChangeKey = "id"
AuditLogChangeKeyType AuditLogChangeKey = "type"
AuditLogChangeKeyEnableEmoticons AuditLogChangeKey = "enable_emoticons"
AuditLogChangeKeyExpireBehavior AuditLogChangeKey = "expire_behavior"
AuditLogChangeKeyExpireGracePeriod AuditLogChangeKey = "expire_grace_period"
)
// AuditLogOptions optional data for the AuditLog
// https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
type AuditLogOptions struct {
DeleteMemberDays string `json:"delete_member_days"`
MembersRemoved string `json:"members_removed"` MembersRemoved string `json:"members_removed"`
ChannelID string `json:"channel_id"` ChannelID string `json:"channel_id"`
MessageID string `json:"message_id"`
Count string `json:"count"` Count string `json:"count"`
ID string `json:"id"` ID string `json:"id"`
Type string `json:"type"` Type *AuditLogOptionsType `json:"type"`
RoleName string `json:"role_name"` RoleName string `json:"role_name"`
} `json:"options,omitempty"`
Reason string `json:"reason"`
} `json:"audit_log_entries"`
} }
// AuditLogOptionsType of the AuditLogOption
// https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
type AuditLogOptionsType string
// Valid Types for AuditLogOptionsType
const (
AuditLogOptionsTypeMember AuditLogOptionsType = "member"
AuditLogOptionsTypeRole AuditLogOptionsType = "role"
)
// AuditLogAction is the Action of the AuditLog (see AuditLogAction* consts)
// https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
type AuditLogAction int
// Block contains Discord Audit Log Action Types // Block contains Discord Audit Log Action Types
const ( const (
AuditLogActionGuildUpdate = 1 AuditLogActionGuildUpdate AuditLogAction = 1
AuditLogActionChannelCreate = 10 AuditLogActionChannelCreate AuditLogAction = 10
AuditLogActionChannelUpdate = 11 AuditLogActionChannelUpdate AuditLogAction = 11
AuditLogActionChannelDelete = 12 AuditLogActionChannelDelete AuditLogAction = 12
AuditLogActionChannelOverwriteCreate = 13 AuditLogActionChannelOverwriteCreate AuditLogAction = 13
AuditLogActionChannelOverwriteUpdate = 14 AuditLogActionChannelOverwriteUpdate AuditLogAction = 14
AuditLogActionChannelOverwriteDelete = 15 AuditLogActionChannelOverwriteDelete AuditLogAction = 15
AuditLogActionMemberKick = 20 AuditLogActionMemberKick AuditLogAction = 20
AuditLogActionMemberPrune = 21 AuditLogActionMemberPrune AuditLogAction = 21
AuditLogActionMemberBanAdd = 22 AuditLogActionMemberBanAdd AuditLogAction = 22
AuditLogActionMemberBanRemove = 23 AuditLogActionMemberBanRemove AuditLogAction = 23
AuditLogActionMemberUpdate = 24 AuditLogActionMemberUpdate AuditLogAction = 24
AuditLogActionMemberRoleUpdate = 25 AuditLogActionMemberRoleUpdate AuditLogAction = 25
AuditLogActionRoleCreate = 30 AuditLogActionRoleCreate AuditLogAction = 30
AuditLogActionRoleUpdate = 31 AuditLogActionRoleUpdate AuditLogAction = 31
AuditLogActionRoleDelete = 32 AuditLogActionRoleDelete AuditLogAction = 32
AuditLogActionInviteCreate = 40 AuditLogActionInviteCreate AuditLogAction = 40
AuditLogActionInviteUpdate = 41 AuditLogActionInviteUpdate AuditLogAction = 41
AuditLogActionInviteDelete = 42 AuditLogActionInviteDelete AuditLogAction = 42
AuditLogActionWebhookCreate = 50 AuditLogActionWebhookCreate AuditLogAction = 50
AuditLogActionWebhookUpdate = 51 AuditLogActionWebhookUpdate AuditLogAction = 51
AuditLogActionWebhookDelete = 52 AuditLogActionWebhookDelete AuditLogAction = 52
AuditLogActionEmojiCreate = 60 AuditLogActionEmojiCreate AuditLogAction = 60
AuditLogActionEmojiUpdate = 61 AuditLogActionEmojiUpdate AuditLogAction = 61
AuditLogActionEmojiDelete = 62 AuditLogActionEmojiDelete AuditLogAction = 62
AuditLogActionMessageDelete = 72 AuditLogActionMessageDelete AuditLogAction = 72
AuditLogActionMessageBulkDelete AuditLogAction = 73
AuditLogActionMessagePin AuditLogAction = 74
AuditLogActionMessageUnpin AuditLogAction = 75
AuditLogActionIntegrationCreate AuditLogAction = 80
AuditLogActionIntegrationUpdate AuditLogAction = 81
AuditLogActionIntegrationDelete AuditLogAction = 82
) )
// A UserGuildSettingsChannelOverride stores data for a channel override for a users guild settings. // A UserGuildSettingsChannelOverride stores data for a channel override for a users guild settings.
@ -885,6 +1050,7 @@ type APIErrorMessage struct {
// Webhook stores the data for a webhook. // Webhook stores the data for a webhook.
type Webhook struct { type Webhook struct {
ID string `json:"id"` ID string `json:"id"`
Type WebhookType `json:"type"`
GuildID string `json:"guild_id"` GuildID string `json:"guild_id"`
ChannelID string `json:"channel_id"` ChannelID string `json:"channel_id"`
User *User `json:"user"` User *User `json:"user"`
@ -893,6 +1059,16 @@ type Webhook struct {
Token string `json:"token"` Token string `json:"token"`
} }
// WebhookType is the type of Webhook (see WebhookType* consts) in the Webhook struct
// https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types
type WebhookType int
// Valid WebhookType values
const (
WebhookTypeIncoming WebhookType = iota
WebhookTypeChannelFollower
)
// WebhookParams is a struct for webhook params, used in the WebhookExecute command. // WebhookParams is a struct for webhook params, used in the WebhookExecute command.
type WebhookParams struct { type WebhookParams struct {
Content string `json:"content,omitempty"` Content string `json:"content,omitempty"`
@ -940,7 +1116,6 @@ type Activity struct {
type ActivityType int type ActivityType int
// Valid ActivityType values // Valid ActivityType values
// https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
const ( const (
ActivityTypeGame GameType = iota ActivityTypeGame GameType = iota
ActivityTypeStreaming ActivityTypeStreaming