Documentation ¶
Index ¶
- type AddTeamMember
- type Alert
- type AlertList
- type AlertPatch
- type AlertPatchItem
- type AlertPriority
- type AlertType
- type Announcement
- type AnnouncementList
- type ApiError
- type AppListResponse
- type AppMeta
- type AppResponse
- type AuthorizeRequest
- type Blog
- type BlogListPost
- type BlogPost
- type BoosterStatus
- type Bot
- type BotFlags
- type BotPack
- type BotSettingsUpdate
- type BotStats
- type Changelog
- type ChangelogEntry
- type CreateBlogPost
- type CreateBot
- type CreateEditTeam
- type CreateTeamResponse
- type DiscordBotMeta
- type EditBlogPost
- type EditTeamMember
- type EntityVote
- type FeaturedUserAlerts
- type GetTestWebhookMeta
- type HCaptchaInfo
- type IndexBot
- type IndexBotPack
- type Invite
- type Link
- type ListIndexBot
- type ListStats
- type Message
- type NotifBrowserInfo
- type NotifGet
- type NotifGetList
- type NotificationInfo
- type OauthMeta
- type PagedResult
- type Partner
- type PartnerList
- type PatchBotTeam
- type PatchWebhook
- type PaymentPlan
- type PermissionData
- type PermissionDataOverride
- type PermissionResponse
- type PermissionUpdate
- type PlanList
- type Position
- type ProfileUpdate
- type PublishBlogPost
- type Question
- type QueueBot
- type QueueBots
- type Reminder
- type ReminderList
- type ResolvedReminder
- type Review
- type ReviewList
- type SDList
- type SDService
- type SEO
- type SearchFilter
- type SearchQuery
- type SearchResponse
- type Server
- type ServiceDiscovery
- type StaffTeam
- type StaffTemplate
- type StaffTemplateList
- type StaffTemplateMeta
- type StatusDocs
- type TagFilter
- type TagMode
- type Team
- type TeamBulkFetch
- type TeamEntities
- type TeamMember
- type TestAuth
- type TestWebhookType
- type TestWebhookVariables
- type Ticket
- type User
- type UserBotPerms
- type UserExperiment
- type UserLogin
- type UserPerm
- type UserSubscription
- type UserVote
- type Vanity
- type VoteInfo
- type VoteWait
- type WebhookLogEntry
- type WebhookType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddTeamMember ¶
type Alert ¶
type Alert struct { ITag pgtype.UUID `` /* 128-byte string literal not displayed */ URL pgtype.Text `db:"url" json:"url" description:"The URL to send the alert to"` // Optional Message string `db:"message" json:"message" validate:"required"` Type AlertType `db:"type" json:"type" validate:"required,oneof=success error info warning"` Title string `db:"title" json:"title" validate:"required"` CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at" description:"The alert's creation date"` Acked bool `db:"acked" json:"acked" description:"Whether the alert has been acknowledged"` AlertData map[string]any `db:"alert_data" json:"alert_data"` // Optional Icon string `db:"icon" json:"icon"` // Optional Priority AlertPriority `db:"priority" json:"priority" enum:"1,2,3"` // Optional }
type AlertPatch ¶
type AlertPatch struct {
Patches []AlertPatchItem `json:"patches" validate:"required" description:"List of patches to apply to alerts"`
}
type AlertPatchItem ¶
type AlertPriority ¶
type AlertPriority int
const ( AlertPriorityLow AlertPriority = iota AlertPriorityMedium AlertPriorityHigh )
type Announcement ¶
type Announcement struct { UserID string `db:"author" json:"-"` Author *dovetypes.PlatformUser `json:"author"` // Must be parsed internally ID pgtype.UUID `db:"id" json:"id"` Title string `db:"title" json:"title"` Content string `db:"content" json:"content"` LastModified time.Time `db:"modified_date" json:"last_modified"` Status string `db:"status" json:"status"` Target pgtype.Text `db:"target" json:"target"` }
An announcement
type AnnouncementList ¶
type AnnouncementList struct {
Announcements []Announcement `json:"announcements"`
}
type ApiError ¶
type ApiError struct { Context map[string]string `json:"context,omitempty" description:"Context of the error. Usually used for validation error contexts"` Message string `json:"message" description:"Message of the error"` }
This represents a IBL Popplio API Error
type AppListResponse ¶
type AppListResponse struct {
Apps []AppResponse `json:"apps"`
}
type AppResponse ¶
type AppResponse struct { AppID string `db:"app_id" json:"app_id"` UserID string `db:"user_id" json:"user_id"` Questions []Question `db:"questions" json:"questions"` Answers map[string]string `db:"answers" json:"answers"` State string `db:"state" json:"state"` CreatedAt time.Time `db:"created_at" json:"created_at"` Position string `db:"position" json:"position"` ReviewFeedback *string `db:"review_feedback" json:"review_feedback"` }
type AuthorizeRequest ¶
type AuthorizeRequest struct { ClientID string `json:"client_id" validate:"required"` Code string `json:"code" validate:"required,min=5"` RedirectURI string `json:"redirect_uri" validate:"required"` Protocol string `` /* 152-byte string literal not displayed */ Scope string `json:"scope" validate:"required,oneof=normal ban_exempt external_auth"` }
type Blog ¶
type Blog struct {
Posts []BlogListPost `json:"posts" description:"The list of blog posts on the blog"`
}
type BlogListPost ¶
type BlogListPost struct { Slug string `db:"slug" json:"slug" description:"The slug/vanity of the blog post"` Title string `db:"title" json:"title" description:"The title of the blog post"` Description string `db:"description" json:"description" description:"The summary/short description of the blog post"` UserID string `db:"user_id" json:"-"` // Must be parsed internally Author *dovetypes.PlatformUser `db:"-" json:"author" description:"The author of the blog post"` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the blog post was created at"` Draft bool `db:"draft" json:"draft" description:"Whether the blog post is a draft or not (hidden or public)"` Tags []string `db:"tags" json:"tags" description:"The tags of the blog post for filtering purposes"` }
type BlogPost ¶
type BlogPost struct { Slug string `db:"slug" json:"slug" description:"The slug/vanity of the blog post"` Title string `db:"title" json:"title" description:"The title of the blog post"` Description string `db:"description" json:"description" description:"The summary/short description of the blog post"` UserID string `db:"user_id" json:"-"` // Must be parsed internally Author *dovetypes.PlatformUser `db:"-" json:"author" description:"The author of the blog post"` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the blog post was created at"` Content string `db:"content" json:"content" description:"The content of the blog post in markdown format"` Draft bool `db:"draft" json:"draft" description:"Whether the blog post is a draft or not (hidden or public)"` Tags []string `db:"tags" json:"tags" description:"The tags of the blog post for filtering purposes"` }
type BoosterStatus ¶
type Bot ¶
type Bot struct { ITag pgtype.UUID `db:"itag" json:"itag" description:"The bot's internal ID. An artifact of database migrations."` BotID string `db:"bot_id" json:"bot_id" description:"The bot's ID"` ClientID string `` /* 149-byte string literal not displayed */ ExtraLinks []Link `db:"extra_links" json:"extra_links" description:"The bot's links that it wishes to advertise"` Tags []string `db:"tags" json:"tags" description:"The bot's tags (e.g. music, moderation, etc.)"` Flags []BotFlags `db:"flags" json:"flags" description:"The bot's flags"` Prefix string `db:"prefix" json:"prefix" description:"The bot's prefix"` User *dovetypes.PlatformUser `db:"-" json:"user" description:"The bot's user information" ci:"internal"` // Must be parsed internally Owner pgtype.Text `db:"owner" json:"-"` MainOwner *dovetypes.PlatformUser `` // Must be parsed internally /* 148-byte string literal not displayed */ Short string `db:"short" json:"short" description:"The bot's short description"` Long string `` /* 135-byte string literal not displayed */ Library string `db:"library" json:"library" description:"The bot's library"` NSFW bool `db:"nsfw" json:"nsfw" description:"Whether the bot is NSFW or not"` Premium bool `db:"premium" json:"premium" description:"Whether the bot is a premium bot or not"` LastStatsPost pgtype.Timestamptz `` /* 126-byte string literal not displayed */ Servers int `db:"servers" json:"servers" description:"The bot's server count"` Shards int `db:"shards" json:"shards" description:"The bot's shard count"` ShardList []int `db:"shard_list" json:"shard_list" description:"The number of servers per shard"` Users int `db:"users" json:"users" description:"The bot's user count"` Votes int `db:"votes" json:"votes" description:"The bot's vote count"` Views int `db:"clicks" json:"clicks" description:"The bot's total click count"` UniqueClicks int64 `db:"-" json:"unique_clicks" description:"The bot's unique click count based on SHA256 hashed IPs" ci:"internal"` // Must be parsed internally InviteClicks int `db:"invite_clicks" json:"invite_clicks" description:"The bot's invite click count (via users inviting the bot from IBL)"` Banner pgtype.Text `db:"banner" json:"banner" description:"The bot's banner URL if it has one, otherwise null"` Invite string `db:"invite" json:"invite" description:"The bot's invite URL. Must be present"` Type string `` /* 154-byte string literal not displayed */ VanityRef pgtype.UUID `` /* 146-byte string literal not displayed */ Vanity string `db:"-" json:"vanity" description:"The bot's vanity URL" ci:"internal"` // Must be parsed internally VoteBanned bool `db:"vote_banned" json:"vote_banned" description:"Whether the bot is vote banned or not"` StartPeriod pgtype.Timestamptz `db:"start_premium_period" json:"start_premium_period"` PremiumPeriodLength time.Duration `db:"premium_period_length" json:"premium_period_length" description:"The period of premium for the bot in nanoseconds"` CertReason pgtype.Text `db:"cert_reason" json:"cert_reason" description:"The reason for the bot being certified"` Uptime int `db:"uptime" json:"uptime" description:"The bot's total number of successful uptime checks"` TotalUptime int `db:"total_uptime" json:"total_uptime" description:"The bot's total number of uptime checks"` UptimeLastChecked pgtype.Timestamptz `db:"uptime_last_checked" json:"uptime_last_checked" description:"The bot's last uptime check"` ClaimedBy pgtype.Text `db:"claimed_by" json:"claimed_by" description:"The user who claimed the bot"` Note pgtype.Text `db:"approval_note" json:"approval_note" description:"The note for the bot's approval"` CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at" description:"The bot's creation date"` LastClaimed pgtype.Timestamptz `db:"last_claimed" json:"last_claimed" description:"The bot's last claimed date"` LegacyWebhooks bool `db:"-" json:"legacy_webhooks" description:"Whether the bot is using legacy v1 webhooks or not" ci:"internal"` // Must be parsed internally TeamOwnerID pgtype.UUID `db:"team_owner" json:"-"` TeamOwner *Team `` // Must be parsed internally /* 161-byte string literal not displayed */ CaptchaOptOut bool `` /* 140-byte string literal not displayed */ }
@ci table=bots
Bot represents a bot.
type BotPack ¶
type BotPack struct { Owner string `db:"owner" json:"-" ci:"internal"` ResolvedOwner *dovetypes.PlatformUser `db:"-" json:"owner"` Name string `db:"name" json:"name"` Short string `db:"short" json:"short"` Votes int `db:"votes" json:"votes" description:"The pack's vote count"` Tags []string `db:"tags" json:"tags"` URL string `db:"url" json:"url"` CreatedAt time.Time `db:"created_at" json:"created_at"` Bots []string `db:"bots" json:"bot_ids"` ResolvedBots []IndexBot `db:"-" json:"bots"` }
Represents a Bot Pack
type BotSettingsUpdate ¶
type BotSettingsUpdate struct { Short string `db:"short" json:"short" validate:"required,min=30,max=150" msg:"Short description must be between 30 and 150 characters"` // impld Long string `db:"long" json:"long" validate:"required,min=500" msg:"Long description must be at least 500 characters"` // impld Prefix string `db:"prefix" json:"prefix" validate:"required,min=1,max=10" msg:"Prefix must be between 1 and 10 characters"` // impld Invite string `db:"invite" json:"invite" validate:"required,https" msg:"Invite is required and must be a valid HTTPS URL"` // impld Banner *string `db:"banner" json:"banner" validate:"omitempty,https" msg:"Background must be a valid HTTPS URL"` // impld Library string `db:"library" json:"library" validate:"required,min=1,max=50" msg:"Library must be between 1 and 50 characters"` // impld ExtraLinks []Link `db:"extra_links" json:"extra_links" validate:"required" msg:"Extra links must be sent"` // Impld Tags []string `` /* 224-byte string literal not displayed */ NSFW bool `db:"nsfw" json:"nsfw"` CaptchaOptOut bool `db:"captcha_opt_out" json:"captcha_opt_out"` }
type Changelog ¶
type Changelog struct {
Entries []ChangelogEntry `json:"entries" validate:"required,dive,required" description:"The changelog entries."`
}
type ChangelogEntry ¶
type ChangelogEntry struct { Version string `json:"version" validate:"required" description:"The version for the changelog entry. (4.3.0 etc.)"` ExtraDescription string `json:"extra_description" description:"The extra description for the version, if applicable"` Prerelease bool `json:"prerelease" description:"Whether or not this is a prerelease."` Added []string `json:"added" validate:"required" description:"The added features for the version."` Updated []string `json:"updated" validate:"required" description:"The changed features for the version."` Removed []string `json:"removed" validate:"required" description:"The removed features for the version."` }
type CreateBlogPost ¶
type CreateBlogPost struct { Slug string `` /* 127-byte string literal not displayed */ Title string `db:"title" json:"title" validate:"required" description:"The title of the blog post"` Description string `db:"description" json:"description" validate:"required" description:"The summary/short description of the blog post"` Content string `db:"content" json:"content" validate:"required" description:"The content of the blog post in markdown format"` Tags []string `db:"tags" json:"tags" validate:"required,dive,required" description:"The tags of the blog post for filtering purposes"` }
type CreateBot ¶
type CreateBot struct { BotID string `db:"bot_id" json:"bot_id" validate:"required,numeric" msg:"Bot ID must be numeric"` // impld ClientID string `db:"client_id" json:"client_id" validate:"required,numeric" msg:"Client ID must be numeric"` // impld Short string `db:"short" json:"short" validate:"required,min=30,max=150" msg:"Short description must be between 30 and 150 characters"` // impld Long string `db:"long" json:"long" validate:"required,min=500" msg:"Long description must be at least 500 characters"` // impld Prefix string `db:"prefix" json:"prefix" validate:"required,min=1,max=10" msg:"Prefix must be between 1 and 10 characters"` // impld Invite string `db:"invite" json:"invite" validate:"required,https" msg:"Invite is required and must be a valid HTTPS URL"` // impld Banner *string `db:"banner" json:"banner" validate:"omitempty,https" msg:"Background must be a valid HTTPS URL"` // impld Library string `db:"library" json:"library" validate:"required,min=1,max=50" msg:"Library must be between 1 and 50 characters"` // impld ExtraLinks []Link `db:"extra_links" json:"extra_links" validate:"required" msg:"Extra links must be sent"` // Impld Tags []string `` /* 224-byte string literal not displayed */ NSFW bool `db:"nsfw" json:"nsfw"` StaffNote *string `db:"approval_note" json:"staff_note" validate:"omitempty,max=512" msg:"Staff note must be less than 512 characters if sent"` // impld TeamOwner string `db:"-" json:"team_owner" ci:"internal"` // May or may not be present // Not needed to send, resolved in backend Owner string `db:"owner" json:"-"` GuildCount *int `db:"servers" json:"-"` VanityRef pgtype.UUID `db:"vanity_ref" json:"-"` }
@ci table=bots, unfilled=1
CreateBot represents the data sent for the creation of a bot.
type CreateEditTeam ¶
type CreateEditTeam struct { Name string `json:"name" validate:"required,nonvulgar,min=3,max=32" msg:"Team name must be between 3 and 32 characters long"` Avatar string `json:"avatar" validate:"required,https" msg:"Avatar must be a valid HTTPS URL"` Banner *string `json:"banner" validate:"omitempty,https" msg:"Background must be a valid HTTPS URL"` // impld Short *string `json:"short" validate:"omitempty,max=150" msg:"Short description must be a maximum of 150 characters"` // impld Tags *[]string `` /* 204-byte string literal not displayed */ ExtraLinks *[]Link `json:"extra_links" description:"The team's links that it wishes to advertise"` }
type CreateTeamResponse ¶
type DiscordBotMeta ¶
type DiscordBotMeta struct { BotID string `json:"bot_id" description:"The bot's ID"` ClientID string `json:"client_id" description:"The bot's client ID"` Name string `json:"name" description:"The bot's name"` Avatar string `json:"avatar" description:"The bot's avatar"` ListType string `json:"list_type" description:"If this is empty, then it is not on the list"` GuildCount int `json:"guild_count" description:"The bot's guild count"` BotPublic bool `json:"bot_public" description:"Whether or not the bot is public"` Flags []string `json:"flags" description:"The bot's flags"` Description string `json:"description" description:"The suggested description for the bot"` Tags []string `json:"tags" description:"The suggested tags for the bot"` Fallback bool `json:"fallback" description:"Whether or not we had to fallback to RPC from JAPI.rest"` }
type EditBlogPost ¶
type EditBlogPost struct { Title string `db:"title" json:"title" validate:"required" description:"The title of the blog post"` Description string `db:"description" json:"description" validate:"required" description:"The summary/short description of the blog post"` Content string `db:"content" json:"content" validate:"required" description:"The content of the blog post in markdown format"` Tags []string `db:"tags" json:"tags" validate:"required,dive,required" description:"The tags of the blog post for filtering purposes"` }
type EditTeamMember ¶
type EditTeamMember struct { PermUpdate *PermissionUpdate `json:"perm_update" description:"The permissions to update"` Mentionable *bool `json:"mentionable" description:"Whether the user is mentionable"` }
type EntityVote ¶
type EntityVote struct { ITag pgtype.UUID `db:"itag" json:"itag" description:"The internal ID of the entity."` TargetType string `db:"target_type" json:"target_type" description:"The type of the entity that was voted on"` TargetID string `db:"target_id" json:"target_id" description:"The ID of the entity that was voted on"` AuthorID string `db:"author" json:"author" description:"The ID of the user who voted"` Upvote bool `db:"upvote" json:"upvote" description:"Whether or not the vote was an upvote"` Void bool `db:"void" json:"void" description:"Whether or not the vote was voided"` VoidReason pgtype.Text `db:"void_reason" json:"void_reason" description:"The reason the vote was voided"` VoidedAt pgtype.Timestamp `db:"voided_at" json:"voided_at" description:"The time the vote was voided, if it was voided"` CreatedAt time.Time `db:"created_at" json:"created_at"` VoteNum int `db:"vote_num" json:"vote_num" description:"The number of the vote (second vote of double vote will have vote_num as 2 etc.)"` }
@ci table=entity_votes
Entity Vote represents a vote on an entity.
type FeaturedUserAlerts ¶
type GetTestWebhookMeta ¶
type GetTestWebhookMeta struct {
Types []TestWebhookType `json:"data"`
}
type HCaptchaInfo ¶
type HCaptchaInfo struct {
SiteKey string `json:"site_key"`
}
type IndexBot ¶
type IndexBot struct { BotID string `db:"bot_id" json:"bot_id" description:"The bot's ID"` User *dovetypes.PlatformUser `db:"-" json:"user" description:"The bot's user information" ci:"internal"` // Must be parsed internally Short string `db:"short" json:"short" description:"The bot's short description"` Type string `db:"type" json:"type" description:"The bot's type (e.g. pending/approved/certified/denied etc.)"` VanityRef pgtype.UUID `` /* 146-byte string literal not displayed */ Vanity string `db:"-" json:"vanity" description:"The bot's vanity URL" ci:"internal"` // Must be parsed internally Votes int `db:"votes" json:"votes" description:"The bot's vote count"` Shards int `db:"shards" json:"shards" description:"The bot's shard count"` Library string `db:"library" json:"library" description:"The bot's library"` InviteClick int `db:"invite_clicks" json:"invite_clicks" description:"The bot's invite click count (via users inviting the bot from IBL)"` Views int `db:"clicks" json:"clicks" description:"The bot's view count"` Servers int `db:"servers" json:"servers" description:"The bot's server count"` NSFW bool `db:"nsfw" json:"nsfw" description:"Whether the bot is NSFW or not"` Tags []string `db:"tags" json:"tags" description:"The bot's tags (e.g. music, moderation, etc.)"` Premium bool `db:"premium" json:"premium" description:"Whether the bot is a premium bot or not"` Banner pgtype.Text `db:"banner" json:"banner" description:"The bot's banner URL if it has one, otherwise null"` }
@ci table=bots, unfilled=1
Represents a 'index bot' (a small subset of the bot object for use in cards etc.)
type IndexBotPack ¶
type IndexBotPack struct { Owner string `db:"owner" json:"owner_id"` Name string `db:"name" json:"name"` Short string `db:"short" json:"short"` Votes int `db:"votes" json:"votes" description:"The pack's vote count"` Tags []string `db:"tags" json:"tags"` URL string `db:"url" json:"url"` CreatedAt time.Time `db:"created_at" json:"created_at"` Bots []string `db:"bots" json:"bot_ids"` }
type Link ¶
type Link struct { Name string `json:"name" description:"Name of the link. Links starting with an underscore are 'asset links' and are not visible"` Value string `json:"value" description:"Value of the link. Must normally be HTTPS with the exception of 'asset links'"` }
A link is any extra link
type ListIndexBot ¶
type ListIndexBot struct { Certified []IndexBot `json:"certified"` Premium []IndexBot `json:"premium"` MostViewed []IndexBot `json:"most_viewed"` Packs []IndexBotPack `json:"packs"` RecentlyAdded []IndexBot `json:"recently_added"` TopVoted []IndexBot `json:"top_voted"` }
List Index
type ListStats ¶
type ListStats struct { TotalBots int64 `json:"total_bots" description:"The list of all bots on the list as ListStatsBot objects (partial bot objects)"` TotalApprovedBots int64 `json:"total_approved_bots" description:"The total number of approved bots on the list"` TotalCertifiedBots int64 `json:"total_certified_bots" description:"The total number of certified bots on the list"` TotalStaff int64 `json:"total_staff" description:"The total number of staff members on the list"` TotalUsers int64 `json:"total_users" description:"The total number of users on the list"` TotalVotes int64 `json:"total_votes" description:"The total number of votes on the list"` TotalPacks int64 `json:"total_packs" description:"The total number of packs on the list"` TotalTickets int64 `json:"total_tickets" description:"The total number of tickets created on the list"` }
type Message ¶
type Message struct { ID string `json:"id"` Timestamp time.Time `json:"timestamp"` // Not in DB, but generated from snowflake ID Content string `json:"content"` Embeds []*discordgo.MessageEmbed `json:"embeds"` AuthorID string `json:"author_id"` Author *dovetypes.PlatformUser `json:"author"` Attachments []*discordgo.MessageAttachment `json:"attachments"` }
type NotifBrowserInfo ¶
type NotifBrowserInfo struct { // The OS of the browser OS string `json:"os" description:"The OS of the browser"` Browser string `json:"browser" description:"The browser"` BrowserVer string `json:"browser_ver" description:"The browser version"` Mobile bool `json:"mobile" description:"Whether the browser is on mobile or not"` }
type NotifGet ¶
type NotifGet struct { Endpoint string `db:"endpoint" json:"endpoint" description:"The endpoint for the subscription returned by PushSubscription"` NotifID string `db:"notif_id" json:"notif_id" description:"The ID of the notification"` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the notification was created"` UA string `db:"ua" json:"-"` // Must be parsed internally BrowserInfo NotifBrowserInfo `db:"-" json:"browser_info" description:"information about the browser attached to the push notification"` // Must be parsed from UA internally }
Notification
type NotifGetList ¶
type NotifGetList struct {
Notifications []NotifGet `json:"notifications"`
}
type NotificationInfo ¶
type NotificationInfo struct {
PublicKey string `json:"public_key"`
}
type PagedResult ¶
type PagedResult[T any] struct { Count uint64 `json:"count"` PerPage uint64 `json:"per_page"` Results T `json:"results"` }
Paged result common
type Partner ¶
type Partner struct { ID string `json:"id" validate:"required"` Name string `json:"name" validate:"required"` Image string `json:"image" validate:"required"` Short string `json:"short" validate:"required"` Links []Link `json:"links" validate:"required,min=1,max=2"` UserID string `json:"-" validate:"required,numeric"` // Internal field User *dovetypes.PlatformUser `json:"user"` }
type PartnerList ¶
type PatchBotTeam ¶
type PatchBotTeam struct {
TeamID string `json:"team_id" description:"The team ID to add the bot to"`
}
type PatchWebhook ¶
type PaymentPlan ¶
type PaymentPlan struct { ID string `json:"id" validate:"required"` Name string `json:"name" validate:"required"` Benefit string `json:"benefit" validate:"required"` // To be fixed TimePeriod int `json:"time_period" validate:"required"` // In seconds Price float32 `json:"price" validate:"required"` // In USD }
type PermissionData ¶
type PermissionDataOverride ¶
type PermissionResponse ¶
type PermissionResponse struct {
Perms []PermissionData `json:"perms"`
}
type PermissionUpdate ¶
type PlanList ¶
type PlanList struct {
Plans []PaymentPlan `json:"plans"`
}
type Position ¶
type Position struct { ID string `json:"id" validate:"required"` Tags []string `json:"tags" validate:"required"` Info string `json:"info" validate:"required"` Name string `json:"name" validate:"required"` Questions []Question `json:"questions" validate:"gt=0,required"` Hidden bool `json:"hidden"` Closed bool `json:"closed"` // Internal fields Channel func() string `json:"-"` ExtraLogic func(d uapi.RouteData, p Position, answers map[string]string) error `json:"-"` PositionDescription func(d uapi.RouteData, p Position) string `json:"-"` // Used for custom position descriptions AllowedForBanned bool `json:"-"` // If true, banned users can apply for this position BannedOnly bool `json:"-"` // If true, only banned users can apply for this position Dummy bool `json:"-"` // If true, the position does not actually persist to the database. This is just a marker and ExtraLogic is required to enforce this ReviewLogic func(d uapi.RouteData, resp AppResponse, reason string, approved bool) error `json:"-"` // If set, this function will be called when the position is reviewed. If it returns true, the app will be approved/denied }
type ProfileUpdate ¶
type PublishBlogPost ¶
type PublishBlogPost struct {
Draft bool `db:"draft" json:"draft" description:"Whether or not the blog post is a draft or not."`
}
type QueueBot ¶
type QueueBot struct { BotID string `db:"bot_id" json:"bot_id" description:"The bot's ID"` User *dovetypes.PlatformUser `db:"-" json:"user" description:"The bot's user information" ci:"internal"` // Must be parsed internally Short string `db:"short" json:"short" description:"The bot's short description"` Long string `db:"long" json:"long" description:"The bot's long description in raw format (HTML/markdown etc. based on the bots settings)"` Type string `db:"type" json:"type" description:"The bot's type (e.g. pending/approved/certified/denied etc.)"` NSFW bool `db:"nsfw" json:"nsfw" description:"Whether the bot is NSFW or not"` Tags []string `db:"tags" json:"tags" description:"The bot's tags (e.g. music, moderation, etc.)"` Premium bool `db:"premium" json:"premium" description:"Whether the bot is a premium bot or not"` Views int `db:"clicks" json:"clicks" description:"The bot's view count"` ClaimedByID pgtype.Text `db:"claimed_by" json:"-"` // Must be parsed internally ClaimedBy *dovetypes.PlatformUser `db:"-" json:"claimed_by" description:"The user who claimed the bot" ci:"internal"` // Must be parsed internally Banner pgtype.Text `db:"banner" json:"banner" description:"The bot's banner URL if it has one, otherwise null"` }
@ci table=bots, unfilled=1
Queue bots are similar to index bots but specifically for the bot queue, they do not have all the information needed to be a `IndexBot` and neither does `IndexBot` provide all the information needed to be a `QueueBot`
type Reminder ¶
type Reminder struct { UserID string `db:"user_id" json:"user_id"` TargetType string `db:"target_type" json:"target_type"` TargetID string `db:"target_id" json:"target_id"` Resolved *ResolvedReminder `db:"-" json:"resolved"` CreatedAt time.Time `db:"created_at" json:"created_at"` LastAcked time.Time `db:"last_acked" json:"last_acked"` }
type ReminderList ¶
type ReminderList struct {
Reminders []Reminder `json:"reminders"`
}
type ResolvedReminder ¶
type Review ¶
type Review struct { ID pgtype.UUID `db:"id" json:"id"` TargetType string `db:"target_type" json:"target_type"` TargetID string `db:"target_id" json:"target_id"` AuthorID string `db:"author" json:"-"` Author *dovetypes.PlatformUser `db:"-" json:"author"` Content string `db:"content" json:"content"` Stars int32 `db:"stars" json:"stars"` CreatedAt time.Time `db:"created_at" json:"created_at"` ParentID pgtype.UUID `db:"parent_id" json:"parent_id"` }
A review is a review on ibl
type ReviewList ¶
type ReviewList struct {
Reviews []Review `json:"reviews"`
}
type SEO ¶
type SEO struct { Name string `json:"name" description:"Name of the entity"` UsernameLegacy string `json:"username" description:"Legacy Field, to be removed"` ID string `json:"id" description:"ID of the entity"` Avatar string `json:"avatar" description:"The entities resolved avatar URL (not just hash)"` Short string `json:"short" description:"Short description of the entity"` }
SEO object (minified bot/user/server for seo purposes)
type SearchFilter ¶
type SearchQuery ¶
type SearchQuery struct { Query string `json:"query"` Servers SearchFilter `json:"servers" msg:"Servers must be a valid filter"` Votes SearchFilter `json:"votes" msg:"Votes must be a valid filter"` Shards SearchFilter `json:"shards" msg:"Shards must be a valid filter"` TagFilter TagFilter `json:"tags" msg:"Tags must be a valid filter"` }
type SearchResponse ¶
type SearchResponse struct {
Bots []IndexBot `json:"bots"`
}
type Server ¶
type Server struct { ServerID string `db:"server_id" json:"server_id" description:"The server's ID"` Name string `db:"name" json:"name" description:"The server's name"` Avatar string `db:"avatar" json:"avatar" description:"The server's avatar"` TotalMembers int `db:"total_members" json:"total_members" description:"The server's total member count"` OnlineMembers int `db:"online_members" json:"online_members" description:"The server's online member count"` InviteURL string `db:"invite_url" json:"-" description:"The server's invite URL"` // Not filled in, as its usually protected by the invite API Short string `db:"short" json:"short" description:"The server's short description"` Long string `` /* 127-byte string literal not displayed */ State string `db:"state" json:"state" description:"The server's state (public, private, unlisted)"` VanityRef pgtype.UUID `db:"vanity_ref" json:"vanity_ref"` Vanity string `db:"-" json:"vanity" description:"The server's vanity URL" ci:"internal"` // Must be parsed internally ExtraLinks []Link `db:"extra_links" json:"extra_links" description:"The server's links that it wishes to advertise"` TeamOwnerID pgtype.UUID `db:"team_owner" json:"-"` TeamOwner *Team `json:"team_owner" description:"If the server is in a team, who owns the server."` // Must be parsed internally }
type ServiceDiscovery ¶
type ServiceDiscovery struct {
Services []SDService `json:"services"`
}
type StaffTemplate ¶
type StaffTemplateList ¶
type StaffTemplateList struct {
Templates []StaffTemplateMeta `json:"templates" validate:"required"`
}
type StaffTemplateMeta ¶
type StaffTemplateMeta struct { Name string `json:"name" validate:"required"` Icon string `json:"icon" validate:"required"` Description string `json:"description" validate:"required"` Templates []StaffTemplate `json:"templates" validate:"required"` }
type StatusDocs ¶
type StatusDocs struct { Key1 string `json:"key1" description:"Some key-value pairs from our status API"` Key2 string `json:"key2" description:"Some key-value pairs from our status API"` Key3 string `json:"key3" description:"Some key-value pairs from our status API"` Etc string `json:"etc" description:"And so on..."` }
type Team ¶
type Team struct { ID string `db:"id" json:"id" description:"The ID of the team"` Name string `db:"name" json:"name" description:"The name of the team"` Avatar string `db:"avatar" json:"avatar" description:"The avatar of the team"` Banner pgtype.Text `db:"banner" json:"banner" description:"The team's banner URL if it has one, otherwise null"` Short pgtype.Text `db:"short" json:"short" description:"The teams's short description if it has one, otherwise null"` Tags []string `db:"tags" json:"tags" description:"The teams's tags if it has any, otherwise null"` Votes int `db:"votes" json:"votes" description:"The teams's vote count"` ExtraLinks []Link `db:"extra_links" json:"extra_links" description:"The teams's links that it wishes to advertise"` Entities *TeamEntities `db:"-" json:"entities" description:"The entities of the team"` // Must be handled internally }
type TeamBulkFetch ¶
type TeamBulkFetch struct {
Teams []Team `json:"teams"`
}
type TeamEntities ¶
type TeamEntities struct { Targets []string `json:"targets,omitempty" description:"The targets available in the response"` Members []TeamMember `json:"members,omitempty" description:"Members of the team"` Bots []IndexBot `json:"bots,omitempty" description:"Bots of the team"` // Must be handled internally }
type TeamMember ¶
type TeamMember struct { ITag pgtype.UUID `db:"itag" json:"itag"` UserID string `db:"user_id" json:"-"` User *dovetypes.PlatformUser `db:"-" json:"user"` Flags []string `db:"flags" json:"flags"` CreatedAt time.Time `db:"created_at" json:"created_at"` Mentionable bool `db:"mentionable" json:"mentionable"` }
type TestWebhookType ¶
type TestWebhookType struct { Type string `json:"type" description:"The type of webhook to test."` Data []TestWebhookVariables }
type TestWebhookVariables ¶
type TestWebhookVariables struct { ID string `json:"id" description:"The ID of the variable."` Name string `json:"name" description:"The name of the variable."` Value string `json:"value" description:"The default value of the variable."` Type WebhookType `json:"type" description:"The type of the variable."` }
type Ticket ¶
type Ticket struct { ID string `db:"id" json:"id"` ChannelID string `db:"channel_id" json:"channel_id"` TopicID string `db:"topic_id" json:"topic_id"` Issue string `db:"issue" json:"issue"` TicketContext map[string]string `db:"ticket_context" json:"ticket_context"` Messages []Message `db:"messages" json:"messages"` UserID string `db:"user_id" json:"-"` Author *dovetypes.PlatformUser `db:"-" json:"author"` CloseUserID pgtype.Text `db:"close_user_id" json:"-"` CloseUser *dovetypes.PlatformUser `db:"-" json:"close_user"` Open bool `db:"open" json:"open"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
type User ¶
type User struct { ITag pgtype.UUID `db:"itag" json:"itag" description:"The user's internal ID. An artifact of database migrations."` ID string `db:"user_id" json:"-"` User *dovetypes.PlatformUser `db:"-" json:"user" ci:"internal"` // Must be handled internally Experiments []string `db:"experiments" json:"experiments" description:"The experiments the user is in"` StaffOnboarded bool `db:"staff_onboarded" json:"staff_onboarded"` StaffOnboardState string `db:"staff_onboard_state" json:"staff_onboard_state"` StaffOnboardLastStartTime pgtype.Timestamptz `db:"staff_onboard_last_start_time" json:"staff_onboard_last_start_time"` StaffOnboardGuild pgtype.Text `db:"staff_onboard_guild" json:"staff_onboard_guild"` StaffRPCLastVerify pgtype.Timestamptz `db:"staff_rpc_last_verify" json:"staff_rpc_last_verify"` StaffOnboardSessionCode pgtype.Text `db:"staff_onboard_session_code" json:"-"` StaffOnboardCurrentOnboardRespId pgtype.Text `db:"staff_onboard_current_onboard_resp_id" json:"-"` Staff bool `db:"staff" json:"staff"` Admin bool `db:"admin" json:"admin"` HAdmin bool `db:"hadmin" json:"hadmin"` Certified bool `db:"certified" json:"certified"` IBLDev bool `db:"ibldev" json:"ibldev"` IBLHDev bool `db:"iblhdev" json:"iblhdev"` Owner bool `db:"owner" json:"owner"` BotDeveloper bool `db:"developer" json:"bot_developer"` BugHunters bool `db:"bug_hunters" json:"bug_hunters"` CaptchaSponsorEnabled bool `db:"captcha_sponsor_enabled" json:"captcha_sponsor_enabled"` ExtraLinks []Link `db:"extra_links" json:"extra_links" description:"The users links that it wishes to advertise"` About pgtype.Text `db:"about" json:"about"` VoteBanned bool `db:"vote_banned" json:"vote_banned"` Banned bool `db:"banned" json:"banned"` UserTeams []Team `db:"-" json:"user_teams" ci:"internal"` // Must be handled internally UserBots []IndexBot `db:"-" json:"user_bots" ci:"internal"` // Must be handled internally UserPacks []IndexBotPack `db:"-" json:"user_packs" ci:"internal"` // Must be handled internally }
@ci table=users
type UserBotPerms ¶
type UserBotPerms struct {
Perms []string `json:"perms" description:"The user's permissions on a bot"`
}
type UserExperiment ¶
type UserExperiment string
const (
ServerListingUserExperiment UserExperiment = "SERVER_LISTING"
)
type UserPerm ¶
type UserPerm struct { ID string `db:"user_id" json:"-"` User *dovetypes.PlatformUser `db:"-" json:"user"` // Must be handled internally Experiments []string `db:"experiments" json:"experiments"` Banned bool `db:"banned" json:"banned"` CaptchaSponsorEnabled bool `db:"captcha_sponsor_enabled" json:"captcha_sponsor_enabled"` VoteBanned bool `db:"vote_banned" json:"vote_banned"` Staff bool `db:"staff" json:"staff"` Admin bool `db:"admin" json:"admin"` HAdmin bool `db:"hadmin" json:"hadmin"` IBLDev bool `db:"ibldev" json:"ibldev"` IBLHDev bool `db:"iblhdev" json:"iblhdev"` Owner bool `db:"owner" json:"owner"` }
type UserSubscription ¶
type UserSubscription struct { Auth string `json:"auth" description:"The auth key for the subscription returned by PushSubscription"` P256dh string `json:"p256dh" description:"The p256dh key for the subscription returned by PushSubscription"` Endpoint string `json:"endpoint" description:"The endpoint for the subscription returned by PushSubscription"` }
A user subscription for push notifications
type UserVote ¶
type UserVote struct { HasVoted bool `json:"has_voted"` ValidVotes []time.Time `json:"valid_votes"` VoteInfo *VoteInfo `json:"vote_info"` Wait *VoteWait `json:"wait"` }
A user vote is a struct containing basic info on a users vote
type Vanity ¶
type Vanity struct { ITag pgtype.UUID `db:"itag" json:"itag" description:"The vanities internal ID."` TargetID string `db:"target_id" json:"target_id" description:"The ID of the entity"` TargetType string `db:"target_type" json:"target_type" description:"The type of the entity"` Code string `db:"code" json:"code" description:"The code of the vanity"` }
type VoteInfo ¶
type VoteInfo struct { PerUser int `json:"per_user" description:"The amount of votes a single vote creates on this entity"` VoteTime uint16 `json:"vote_time" description:"The amount of time in hours until a user can vote again"` }
Vote Info
type VoteWait ¶
type VoteWait struct { Hours int `json:"hours"` Minutes int `json:"minutes"` Seconds int `json:"seconds"` }
Stores the hours, minutes and seconds until the user can vote again
type WebhookLogEntry ¶
type WebhookLogEntry struct { ID pgtype.UUID `db:"id" json:"id" description:"The ID of the webhook log."` TargetID string `db:"target_id" json:"target_id" description:"The target ID."` TargetType string `db:"target_type" json:"target_type" description:"The target type (bot/team etc.)."` UserID string `db:"user_id" json:"-"` User *dovetypes.PlatformUser `db:"-" json:"user" description:"User ID the webhook is intended for" ci:"internal"` // Must be parsed internally URL string `db:"url" json:"url" description:"The URL of the webhook."` Data map[string]any `db:"data" json:"data" description:"The data of the webhook."` Response pgtype.Text `db:"response" json:"response" description:"The response of the webhook request."` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time when the webhook was created."` State string `db:"state" json:"state" description:"The state of the webhook."` Tries int `db:"tries" json:"tries" description:"The number of send tries attempted on this webhook."` LastTry time.Time `db:"last_try" json:"last_try" description:"The time of the last send try."` BadIntent bool `db:"bad_intent" json:"bad_intent" description:"Whether the webhook was sent with bad intent."` StatusCode int `db:"status_code" json:"status_code" description:"The status code of the webhook request."` }
@ci table=webhook_logs
Webhook log
type WebhookType ¶
type WebhookType = string
const ( WebhookTypeText WebhookType = "text" WebhookTypeNumber WebhookType = "number" WebhookTypeChangeset WebhookType = "changeset" )