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 Asset
- type AssetMetadata
- type Attachment
- type AuthorizeRequest
- type Blog
- type BlogListPost
- type BlogPost
- type BoosterStatus
- type Bot
- type BotPack
- type BotSettingsUpdate
- type BotStats
- type CacheServer
- type CacheServerBot
- type Changelog
- type ChangelogEntry
- type CreateBlogPost
- type CreateBot
- type CreateEditTeam
- type CreateEditWebhook
- type CreateReview
- type CreateSession
- type CreateSessionResponse
- type CreateTeamResponse
- type DiscordBotMeta
- type EditBlogPost
- type EditReview
- type EditTeamMember
- type EntityVote
- type EntityVoteRedeemLog
- type EntityVoteRedeemLogSummary
- type FeaturedUserAlerts
- type GetTestWebhookMeta
- type HCaptchaInfo
- type IndexBot
- type IndexServer
- type Invite
- type Link
- type ListIndexBot
- type ListIndexServer
- type ListStats
- type Message
- type NotifBrowserInfo
- type NotifGet
- type NotifGetList
- type NotificationInfo
- type OauthMeta
- type PagedResult
- type Partner
- type PartnerList
- type PartnerTypes
- type PatchBotTeam
- type PatchVanity
- type PaymentPlan
- type PermissionData
- type PermissionDataOverride
- type PermissionResponse
- type PlanList
- type Position
- type ProfileUpdate
- type PublishBlogPost
- type Question
- type RandomBots
- type RandomServers
- type Reminder
- type ReminderList
- type ResolvedReminder
- type Review
- type ReviewList
- type SEO
- type SearchFilter
- type SearchQuery
- type SearchResponse
- type Server
- type ServerSettingsUpdate
- type Session
- type SessionList
- type ShopCoupon
- type ShopItem
- type ShopItemBenefit
- type StaffMember
- type StaffPosition
- type StaffTeam
- type StaffTemplate
- type StaffTemplateList
- type StaffTemplateType
- type StatusDocs
- type TagFilter
- type TagMode
- type Task
- type TaskCreateResponse
- type Team
- type TeamBulkFetch
- type TeamEntities
- type TeamMember
- type TestAuth
- type TestWebhookType
- type TestWebhookVariables
- type Ticket
- type User
- type UserEntityPerms
- type UserExperiment
- type UserLogin
- type UserPerm
- type UserSubscription
- type UserVote
- type Vanity
- type VoteCreditTier
- type VoteCreditTierRedeemSummary
- type VoteInfo
- type VoteWait
- type Webhook
- 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 NoSave bool `db:"-" json:"-"` // This is an internal field used to determine whether or not to save the alert to the database or not }
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"` User *dovetypes.PlatformUser `db:"-" json:"user,omitempty"` 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 AssetMetadata ¶
type AssetMetadata struct { Exists bool `json:"exists" description:"Whether the asset exists or not"` Path string `json:"path,omitempty" description:"The path to the asset based on $cdnUrl"` DefaultPath string `json:"default_path" description:"The path to the default asset based on $cdnUrl. May be empty if there is no default asset"` Type string `json:"type,omitempty" description:"Asset type (banner, icon etc.)"` Size int64 `json:"size,omitempty" description:"The size of the asset in bytes, if it exists"` LastModified *time.Time `json:"last_modified,omitempty" description:"The last modified date of the asset, if it exists"` Errors []string `json:"errors,omitempty" description:"Any errors that occurred while trying to get the asset"` }
type Attachment ¶
type Attachment struct { ID string `json:"id"` // ID of the attachment within the ticket Name string `json:"name"` // Name of the attachment ContentType string `json:"content_type"` // Content type of the attachment Size int `json:"size"` // Size of the attachment in bytes Errors []string `json:"errors"` // Non-fatal errors that occurred while uploading the attachment }
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.)"` 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 `` // Must be parsed internally /* 213-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:"-" json:"votes" description:"The bot's vote count" ci:"internal"` // Votes are retrieved from entity_votes ApproximateVotes int `` /* 127-byte string literal not displayed */ Clicks 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 *AssetMetadata `db:"-" json:"banner" description:"Banner information/metadata" ci:"internal"` // Must be parsed internally 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 timex.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"` 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"` ClaimedBy pgtype.Text `db:"claimed_by" json:"claimed_by" description:"The user who claimed the bot"` UpdatedAt pgtype.Timestamptz `db:"updated_at" json:"updated_at" description:"The bot's last update date"` LastClaimed pgtype.Timestamptz `db:"last_claimed" json:"last_claimed" description:"The bot's last claimed date"` 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 */ CacheServerUninvitable pgtype.Text `` /* 170-byte string literal not displayed */ CacheServer *CacheServer `db:"-" json:"cache_server,omitempty" description:"The cache server the bot is in. May not always be present" ci:"internal"` // Must be parsed internally }
@ci table=bots, ignore_fields=api_token+unique_clicks
Bot represents a bot.
type BotPack ¶
type BotPack struct { Owner string `db:"owner" json:"-" description:"The owner of the pack"` ResolvedOwner *dovetypes.PlatformUser `db:"-" json:"owner" ci:"internal" description:"The resolved owner of the pack"` // Owner must be resolved internally from the owner field Name string `db:"name" json:"name" description:"The pack's name"` Short string `db:"short" json:"short" description:"The pack's short description"` Votes int `db:"-" json:"votes" description:"The pack's vote count" ci:"internal"` // Votes are retrieved from entity_votes Tags []string `db:"tags" json:"tags" description:"The pack's tags"` URL string `db:"url" json:"url" description:"The pack's URL"` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The pack's creation date"` Bots []string `db:"bots" json:"bot_ids" description:"The pack's bot IDs"` ResolvedBots []IndexBot `db:"-" json:"bots" ci:"internal" description:"The resolved bots in the pack"` // Bots must be resolved internally from their IDs VoteBanned bool `db:"vote_banned" json:"vote_banned" description:"Whether the pack is banned from voting"` }
@ci table=packs, unfilled=1
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 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 CacheServer ¶
type CacheServer struct { GuildID string `db:"guild_id" json:"guild_id" description:"The guild ID"` BotsRole string `db:"bots_role" json:"bots_role" description:"The bots role ID"` SystemBotsRole string `db:"system_bots_role" json:"system_bots_role" description:"The system bots role ID"` LogsChannel string `db:"logs_channel" json:"logs_channel" description:"The logs channel ID"` StaffRole string `db:"staff_role" json:"staff_role" description:"The staff role ID"` WelcomeChannel string `db:"welcome_channel" json:"welcome_channel" description:"The welcome channel ID"` InviteCode string `db:"invite_code" json:"invite_code" description:"The invite code"` Name string `db:"name" json:"name" description:"The name of the cache server"` CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at" description:"The creation date of the cache server"` Bots []CacheServerBot `db:"-" json:"bots,omitempty" description:"The bots in the cache server. May not always be present" ci:"internal"` // Must be parsed internally }
type CacheServerBot ¶
type CacheServerBot struct { BotID string `db:"bot_id" json:"bot_id" description:"The bot ID"` CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at" description:"The creation date of the bot in the cache server"` Added int `db:"added" json:"added" description:"How many attempts were needed to add the bot. Is usually 0"` }
type Changelog ¶
type Changelog struct {
Entries []ChangelogEntry `json:"entries" validate:"required,dive,required" description:"The changelog entries."`
}
type ChangelogEntry ¶
type ChangelogEntry struct { Version string `db:"version" json:"version" validate:"required" description:"The version for the changelog entry. (4.3.0 etc.)"` ExtraDescription string `db:"extra_description" json:"extra_description" description:"The extra description for the version, if applicable"` GithubHTML pgtype.Text `db:"github_html" json:"github_html" description:"The Github-backed HTML for the changelog entry."` Published bool `db:"published" json:"published" description:"Whether or not this is a published changelog"` Prerelease bool `db:"prerelease" json:"prerelease" description:"Whether or not this is a prerelease."` Added []string `db:"added" json:"added" validate:"required" description:"The added features for the version."` Updated []string `db:"updated" json:"updated" validate:"required" description:"The changed features for the version."` Removed []string `db:"removed" json:"removed" validate:"required" description:"The removed features for the version."` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the changelog entry was created."` }
@ci table=changelogs
Changelogs for the list
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 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"` 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"` NSFW *bool `json:"nsfw" description:"Whether the team is NSFW (primarily makes NSFW content)"` }
type CreateEditWebhook ¶
type CreateEditWebhook struct { Name string `json:"name" description:"The name of the webhook." validate:"required"` Url string `json:"url" description:"The URL of the webhook." validate:"required"` Secret string `json:"secret" description:"The secret of the webhook, only needed for custom (non-discord) webhooks"` SimpleAuth bool `` /* 126-byte string literal not displayed */ EventWhitelist []string `` /* 134-byte string literal not displayed */ }
Represents the data to be sent to create a webhook
type CreateReview ¶
type CreateReview struct { Content string `db:"content" json:"content" validate:"required,min=5,max=4000" msg:"Content must be between 5 and 4000 characters"` Stars int32 `db:"stars" json:"stars" validate:"required,min=1,max=5" msg:"Stars must be between 1 and 5 stars"` ParentID string `db:"parent_id" json:"parent_id" validate:"omitempty,uuid" msg:"Parent ID must be a valid UUID if provided"` OwnerReview bool `db:"owner_review" json:"owner_review" description:"Whether or not the review is an owner review"` }
type CreateSession ¶
type CreateSession struct { Name string `json:"name" validate:"required" description:"The name of the session"` Type string `` /* 170-byte string literal not displayed */ PermLimits []string `json:"perm_limits" description:"The permissions the session will have"` Expiry int64 `json:"expiry" validate:"required" description:"The time in seconds the session will last"` }
type CreateSessionResponse ¶
type CreateTeamResponse ¶
type CreateTeamResponse struct {
TeamID string `json:"team_id" description:"The ID of the created team"`
}
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"` FetchErrors map[string]string `json:"fetch_errors" description:"The errors that occurred when fetching the bot"` }
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 EditReview ¶
type EditTeamMember ¶
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.)"` Credit pgtype.UUID `` /* 136-byte string literal not displayed */ Immutable bool `db:"immutable" json:"immutable" description:"Whether or not the vote is immutable"` }
@ci table=entity_votes
Entity Vote represents a vote on an entity.
type EntityVoteRedeemLog ¶
type EntityVoteRedeemLog struct { ID pgtype.UUID `db:"id" json:"id" description:"The ID of the vote credit redeem log"` TargetID string `db:"target_id" json:"target_id" description:"The ID of the entity that was voted on"` TargetType string `db:"target_type" json:"target_type" description:"The type of the entity that was voted on"` Credits int `db:"credits" json:"credits" description:"The amount of credits redeemed"` RedeemedCredits int `db:"redeemed_credits" json:"redeemed_credits" description:"The amount of credits redeemed"` CreatedAt time.Time `db:"created_at" json:"created_at"` RedeemedAt *time.Time `db:"redeemed_at" json:"redeemed_at" description:"The last time the credits were redeemed for a transaction, if applicable"` }
Represents a vote credit redeem log
type EntityVoteRedeemLogSummary ¶
type EntityVoteRedeemLogSummary struct { Redeems []*EntityVoteRedeemLog `json:"redeems" description:"The vote credit redeem logs"` TotalCredits int `json:"total_credits" description:"The total amount of credits available"` AvailableCredits int `json:"available_credits" description:"The total amount of credits that can be redeemed"` RedeemedCredits int `json:"redeemed_credits" description:"The total amount of credits that have been redeemed"` }
Summary of the entity vote redeem log
type FeaturedUserAlerts ¶
type GetTestWebhookMeta ¶
type GetTestWebhookMeta struct {
Types []TestWebhookType `json:"data" description:"The types of webhooks to test."`
}
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:"-" json:"votes" description:"The bot's vote count" ci:"internal"` // Votes are retrieved from entity_votes ApproximateVotes int `` /* 127-byte string literal not displayed */ 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)"` Clicks 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 *AssetMetadata `db:"-" json:"banner" description:"Banner information/metadata" ci:"internal"` // Must be parsed internally CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at" description:"The creation date of the bot"` }
@ci table=bots, unfilled=1
Represents a 'index bot' (a small subset of the bot object for use in cards etc.)
type IndexServer ¶
type IndexServer 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 *AssetMetadata `db:"-" json:"avatar" description:"The server's avatar" ci:"internal"` // This is an asset that must be validated/loaded from CDN 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"` Short string `db:"short" json:"short" description:"The server's short description"` Type string `db:"type" json:"type" description:"The server's type (e.g. pending/approved/certified/denied etc.)"` State string `db:"state" json:"state" description:"The server's state (public, private, unlisted, defunct)"` VanityRef pgtype.UUID `` /* 149-byte string literal not displayed */ Vanity string `db:"-" json:"vanity" description:"The server's vanity URL" ci:"internal"` // Must be parsed internally Votes int `db:"-" json:"votes" description:"The server's vote count" ci:"internal"` // Votes are retrieved from entity_votes ApproximateVotes int `` /* 130-byte string literal not displayed */ InviteClicks int `` /* 126-byte string literal not displayed */ Clicks int `db:"clicks" json:"clicks" description:"The server's view count"` NSFW bool `db:"nsfw" json:"nsfw" description:"Whether the server is NSFW or not"` Tags []string `db:"tags" json:"tags" description:"The server's tags (e.g. music, moderation, etc.)"` Premium bool `db:"premium" json:"premium" description:"Whether the server is a premium server or not"` Banner *AssetMetadata `db:"-" json:"banner" description:"Banner information/metadata" ci:"internal"` // Must be parsed internally }
@ci table=servers, unfilled=1
Represents a 'index server' (a small subset of the server object for use in cards etc.)
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" description:"The certified bots"` Premium []IndexBot `json:"premium" description:"The premium bots"` MostViewed []IndexBot `json:"most_viewed" description:"The most viewed bots"` Packs []BotPack `json:"packs" description:"The bot packs"` RecentlyAdded []IndexBot `json:"recently_added" description:"The recently added bots"` TopVoted []IndexBot `json:"top_voted" description:"The top voted bots"` }
List Index
type ListIndexServer ¶
type ListIndexServer struct { Certified []IndexServer `json:"certified" description:"The certified servers (if any)"` Premium []IndexServer `json:"premium" description:"The premium servers, usually limited to 12"` MostViewed []IndexServer `json:"most_viewed" description:"The most viewed servers, usually limited to 12"` RecentlyAdded []IndexServer `json:"recently_added" description:"The recently added servers, usually limited to 12"` TopVoted []IndexServer `json:"top_voted" description:"The top voted servers, usually limited to 12"` }
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 []Attachment `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 `db:"id" json:"id" description:"The partners ID" validate:"required"` Name string `db:"name" json:"name" description:"The partners name" validate:"required"` Avatar *AssetMetadata `db:"-" json:"avatar" description:"The partners avatar" ci:"internal"` // Must be parsed internally Short string `db:"short" json:"short" description:"Short description of the partner" validate:"required"` Links []Link `db:"links" json:"links" description:"Links of the partners" validate:"required,min=1,max=2"` Type string `db:"type" json:"type" description:"Type of partner" validate:"required"` CreatedAt time.Time `db:"created_at" json:"created_at" description:"When the partner was created on DB" validate:"required"` UserID string `db:"user_id" json:"-" description:"User ID of the partner. Is an internal field" validate:"required"` User *dovetypes.PlatformUser `db:"-" json:"user" description:"The partner's user information" ci:"internal"` // Must be parsed internally BotID *string `db:"-" json:"bot_id" description:"The bot ID that is associated with the partner"` }
@ci table=partners
Partner represents a IBL partner.
type PartnerList ¶
type PartnerList struct { Partners []Partner `json:"partners"` PartnerTypes []PartnerTypes `json:"partner_types"` }
type PartnerTypes ¶
type PartnerTypes struct { ID string `db:"id" json:"id" description:"The partner type ID"` Name string `db:"name" json:"name" description:"The partner type name"` Short string `db:"short" json:"short" description:"Short description of the partner type"` Icon string `db:"icon" json:"icon" description:"Iconify icon of the partner type"` CreatedAt time.Time `db:"created_at" json:"created_at" description:"When the partner type was created on DB"` }
@ci table=partner_types
PartnerTypes represents a IBL partner type.
type PatchBotTeam ¶
type PatchBotTeam struct {
TeamID string `json:"team_id" description:"The team ID to add the bot to"`
}
type PatchVanity ¶
type PatchVanity struct {
Code string `json:"code" description:"The new vanity code to use" validate:"required"`
}
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 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"` Cooldown timex.Duration `json:"cooldown"` // 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 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 RandomBots ¶
type RandomBots struct {
Bots []IndexBot `json:"bots"`
}
type RandomServers ¶
type RandomServers struct {
Servers []IndexServer `json:"servers"`
}
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" description:"The review ID"` TargetType string `db:"target_type" json:"target_type" description:"The target type (bot/server) the review is for"` TargetID string `db:"target_id" json:"target_id" description:"The target ID the review is for"` AuthorID string `db:"author" json:"-" description:"The author ID of the review"` Author *dovetypes.PlatformUser `db:"-" json:"author" description:"The author of the review"` OwnerReview bool `db:"owner_review" json:"owner_review" description:"Whether or not the review is an owner review"` 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"` 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"` TargetTypes []string `json:"target_types"` // Defaults to 'bot' if unset 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"` TotalMembers SearchFilter `json:"total_members" msg:"Total members must be a valid filter"` TagFilter TagFilter `json:"tags" msg:"Tags must be a valid filter"` }
type SearchResponse ¶
type SearchResponse struct { TargetTypes []string `json:"target_types"` Bots []IndexBot `json:"bots,omitempty"` Servers []IndexServer `json:"servers,omitempty"` }
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 *AssetMetadata `db:"-" json:"avatar" description:"The server's avatar" ci:"internal"` // This is an asset that must be validated/loaded from CDN 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"` Short string `db:"short" json:"short" description:"The server's short description"` Long string `` // Must be parsed internally /* 221-byte string literal not displayed */ Type string `db:"type" json:"type" description:"The server's type (e.g. pending/approved/certified/denied etc.)"` State string `db:"state" json:"state" description:"The server's state (public, private, unlisted, defunct)"` Tags []string `db:"tags" json:"tags" description:"The server's tags"` 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 `db:"-" json:"team_owner" description:"If the server is in a team, who owns the server." ci:"internal"` // Must be parsed internally InviteClicks int `` /* 126-byte string literal not displayed */ Banner *AssetMetadata `db:"-" json:"banner" description:"Banner information/metadata" ci:"internal"` // Must be parsed internally Clicks int `db:"clicks" json:"clicks" description:"The server's total click count"` UniqueClicks int64 `db:"-" json:"unique_clicks" description:"The server's unique click count based on SHA256 hashed IPs" ci:"internal"` // Must be parsed internally NSFW bool `db:"nsfw" json:"nsfw" description:"Whether the serber is NSFW or not"` ApproximateVotes int `` /* 127-byte string literal not displayed */ Votes int `db:"-" json:"votes" description:"The server's vote count" ci:"internal"` // Votes are retrieved from entity_votes VoteBanned bool `db:"vote_banned" json:"vote_banned" description:"Whether the server is vote banned or not"` Premium bool `db:"premium" json:"premium" description:"Whether the server is a premium server 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 server in nanoseconds"` CaptchaOptOut bool `` /* 143-byte string literal not displayed */ CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at" description:"The server's creation date"` ClaimedBy pgtype.Text `db:"claimed_by" json:"claimed_by" description:"The user who claimed the server"` LastClaimed pgtype.Timestamptz `db:"last_claimed" json:"last_claimed" description:"The server's last claimed date"` LoginRequiredForInvite bool `` /* 133-byte string literal not displayed */ }
@ci table=servers, ignore_fields=invite+blacklisted_users+api_token+unique_clicks
Server represents a server.
type ServerSettingsUpdate ¶
type ServerSettingsUpdate 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 ExtraLinks []Link `db:"extra_links" json:"extra_links" validate:"required" msg:"Extra links must be sent"` // Impld State string `` /* 145-byte string literal not displayed */ Tags []string `` /* 224-byte string literal not displayed */ NSFW bool `db:"nsfw" json:"nsfw"` CaptchaOptOut bool `db:"captcha_opt_out" json:"captcha_opt_out"` LoginRequiredForInvite bool `` /* 133-byte string literal not displayed */ }
type Session ¶
type Session struct { ID string `db:"id" json:"id" description:"The ID of the session"` Name pgtype.Text `db:"name" json:"name,omitempty" description:"The name of the session. Login sessions do not have any names by default"` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the session was created"` Type string `db:"type" json:"type" description:"The type of session token"` TargetType string `db:"target_type" json:"target_type" description:"The target (entities) type"` TargetID string `db:"target_id" json:"target_id" description:"The target (entities) ID"` PermLimits []string `db:"perm_limits" json:"perm_limits" description:"The permissions the session has"` Expiry time.Time `db:"expiry" json:"expiry" description:"The time the session expires"` }
@ci table=api_sessions ignore_fields=token
Represents a session that can be used to authorize/identify a user
type SessionList ¶
type SessionList struct {
Sessions []*Session `json:"sessions" description:"The list of sessions"`
}
A list of sessions.
type ShopCoupon ¶
type ShopCoupon struct { ID string `db:"id" json:"id" description:"The ID of the shop coupon"` Code string `db:"code" json:"code" description:"The code of the shop coupon"` Public bool `db:"public" json:"public" description:"Whether the coupon is publicly listable or not"` MaxUses *int `` /* 138-byte string literal not displayed */ Cents *float64 `` /* 148-byte string literal not displayed */ Requirements []string `db:"requirements" json:"requirements" description:"The requirements that must be met to use the coupon"` AllowedUsers []string `` /* 138-byte string literal not displayed */ CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the shop coupon was created"` LastUpdated time.Time `db:"last_updated" json:"last_updated" description:"The time the shop coupon was last updated"` CreatedByID string `db:"created_by" json:"-"` CreatedBy *dovetypes.PlatformUser `db:"-" json:"created_by" description:"The user who created the shop coupon" ci:"internal"` // CreatedByID must be parsed internally UpdatedByID string `db:"updated_by" json:"-"` UpdatedBy *dovetypes.PlatformUser `db:"-" json:"updated_by" description:"The user who last updated the shop coupon" ci:"internal"` // UpdatedByID must be parsed internally ReuseWaitDuration *int `` /* 219-byte string literal not displayed */ Expiry *int `` /* 148-byte string literal not displayed */ ApplicableItems []string `db:"applicable_items" json:"applicable_items" description:"The items the coupon can be applied to (array of shop item ids)"` Usable bool `db:"usable" json:"usable" description:"Whether the coupon is usable or not"` TargetTypes []string `db:"target_types" json:"target_types" description:"The types of entities this coupon can be applied to"` }
@ci table=shop_coupons
ShopCoupon represents a coupon that can be used to get a discount/complete price removal on a shop item.
type ShopItem ¶
type ShopItem struct { ID string `db:"id" json:"id" description:"The ID of the shop item"` Name string `db:"name" json:"name" description:"The friendly name of the shop item"` Cents float64 `db:"cents" json:"cents" description:"The cost of the shop item in cents"` TargetTypes []string `db:"target_types" json:"target_types" description:"The types of entities this item can be applied to"` Benefits []string `db:"benefits" json:"benefits" description:"The benefits of the shop item (array of ids)"` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the shop item benefit was created"` LastUpdated time.Time `db:"last_updated" json:"last_updated" description:"The time the shop item benefit was last updated"` CreatedByID string `db:"created_by" json:"-"` CreatedBy *dovetypes.PlatformUser `db:"-" json:"created_by" description:"The user who created the shop coupon" ci:"internal"` // CreatedByID must be parsed internally UpdatedByID string `db:"updated_by" json:"-"` UpdatedBy *dovetypes.PlatformUser `db:"-" json:"updated_by" description:"The user who last updated the shop coupon" ci:"internal"` // UpdatedByID must be parsed internally Duration int64 `db:"duration" json:"duration" description:"The duration the shop item will last for in hours"` Description string `db:"description" json:"description" description:"The description of the shop item"` }
@ci table=shop_items
ShopItems represent items that can be purchased in the shop.
type ShopItemBenefit ¶
type ShopItemBenefit struct { ID string `db:"id" json:"id" description:"The ID of the shop item benefit"` Name string `db:"name" json:"name" description:"The friendly name of the shop item benefit"` Description string `db:"description" json:"description" description:"The description of the shop item benefit"` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the shop item benefit was created"` LastUpdated time.Time `db:"last_updated" json:"last_updated" description:"The time the shop item benefit was last updated"` CreatedByID string `db:"created_by" json:"-"` CreatedBy *dovetypes.PlatformUser `db:"-" json:"created_by" description:"The user who created the shop coupon" ci:"internal"` // CreatedByID must be parsed internally UpdatedByID string `db:"updated_by" json:"-"` UpdatedBy *dovetypes.PlatformUser `db:"-" json:"updated_by" description:"The user who last updated the shop coupon" ci:"internal"` // UpdatedByID must be parsed internally TargetTypes []string `db:"target_types" json:"target_types" description:"The types of entities this benefit applies to/supports"` }
@ci table=shop_item_benefits
ShopItemBenefit represents a benefit of a shop item which can then be supported in code for certain functionality.
type StaffMember ¶
type StaffMember struct { ID string `db:"user_id" json:"-"` User *dovetypes.PlatformUser `db:"-" json:"user" ci:"internal"` // Must be handled internally PositionIDs []pgtype.UUID `db:"positions" json:"-"` Positions []StaffPosition `db:"-" json:"positions" ci:"internal"` // Must be handled internally PermOverrides []string `db:"perm_overrides" json:"perm_overrides"` NoAutosync bool `db:"no_autosync" json:"no_autosync"` MFAVerified bool `db:"mfa_verified" json:"mfa_verified"` Unaccounted bool `db:"unaccounted" json:"unaccounted"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
@ci table=staff_members unfilled=1
type StaffPosition ¶
type StaffPosition struct { ID pgtype.UUID `db:"id" json:"id"` Name string `db:"name" json:"name"` RoleID string `db:"role_id" json:"role_id"` Perms []string `db:"perms" json:"perms"` CreatedAt time.Time `db:"created_at" json:"created_at"` Index int `db:"index" json:"index"` CorrespondingRoles []Link `db:"corresponding_roles" json:"corresponding_roles"` Icon string `db:"icon" json:"icon"` }
@ci table=staff_positions
type StaffTeam ¶
type StaffTeam struct {
Members []StaffMember `json:"members"`
}
type StaffTemplate ¶
type StaffTemplate struct { ID string `db:"id" json:"id"` Name string `db:"name" json:"name"` Emoji string `db:"emoji" json:"emoji"` Tags []string `db:"tags" json:"tags"` Description string `db:"description" json:"description"` Type string `db:"type" json:"type"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
type StaffTemplateList ¶
type StaffTemplateList struct { TemplateTypes []StaffTemplateType `json:"template_types"` Templates []StaffTemplate `json:"templates"` }
type StaffTemplateType ¶
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 Task ¶
type Task struct { TaskId string `db:"task_id" json:"task_id" validate:"required" description:"The task ID."` TaskKey pgtype.Text `db:"task_key" json:"-" validate:"required" description:"The task key."` AllowUnauthenticated bool `db:"allow_unauthenticated" json:"allow_unauthenticated" description:"Whether the task can be accessed without authentication"` TaskName string `db:"task_name" json:"task_name" validate:"required" description:"The task name."` Output map[string]any `db:"output" json:"output" description:"The task output."` Statuses []map[string]any `db:"statuses" json:"statuses" validate:"required" description:"The task statuses."` ForUser pgtype.Text `db:"for_user" json:"for_user" description:"The user this task is for."` Expiry pgtype.Interval `db:"expiry" json:"expiry" validate:"required" description:"The task expiry."` State string `db:"state" json:"state" validate:"required" description:"The tasks current state (pending/completed etc)."` CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at" description:"The time the task was created."` }
@ci table=tasks
Tasks are background processes that can be run on the server.
type TaskCreateResponse ¶
type TaskCreateResponse struct { TaskID string `json:"task_id" description:"The ID of the newly created task"` TaskKey pgtype.Text `json:"task_key" description:"The key of the newly created task"` AllowUnauthenticated bool `json:"allow_unauthenticated" description:"Whether the task can be accessed without authentication"` TaskName string `db:"task_name" json:"task_name" validate:"required" description:"The task name."` Expiry pgtype.Interval `db:"expiry" json:"expiry" validate:"required" description:"The task expiry."` }
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 *AssetMetadata `db:"-" json:"avatar" description:"The avatar of the team" ci:"internal"` // This is an asset that must be validated/loaded from CDN Banner *AssetMetadata `db:"-" json:"banner" description:"Banner information/metadata" ci:"internal"` // This is an asset that must be validated/loaded from CDN 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"` VoteBanned bool `db:"vote_banned" json:"vote_banned" description:"Whether the team is banned from voting"` ApproximateVotes int `db:"approximate_votes" json:"approximate_votes" description:"The team's approximate vote count."` Votes int `db:"-" json:"votes" description:"The team's vote count" ci:"internal"` // Votes are retrieved from entity_votes 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" ci:"internal"` // Must be handled internally NSFW bool `db:"nsfw" json:"nsfw" description:"Whether the team is NSFW (primarily makes NSFW content)"` VanityRef pgtype.UUID `` /* 147-byte string literal not displayed */ Vanity string `db:"-" json:"vanity" description:"The team's vanity URL" ci:"internal"` // Must be parsed internally Service string `db:"service" json:"service" description:"The service which added the team (api/infernoplex) etc."` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the team was created"` UpdatedAt time.Time `db:"updated_at" json:"updated_at" description:"The time the team was last updated"` }
@ci table=teams
Team represents a team on Infinity List.
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"` Servers []IndexServer `json:"servers,omitempty" description:"Servers of the team"` }
type TeamMember ¶
type TeamMember struct { ITag pgtype.UUID `db:"itag" json:"itag" description:"The ID of the team member"` TeamID string `db:"team_id" json:"team_id" description:"The ID of the team"` UserID string `db:"user_id" json:"-" description:"The ID of the user"` User *dovetypes.PlatformUser `db:"-" json:"user" description:"A user object representing the user" ci:"internal"` // Must be handled internally Flags []string `db:"flags" json:"flags" description:"The permissions/flags of the team member"` Service string `db:"service" json:"service" description:"The service which added a team member (api/infernoplex) etc."` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the team member was added"` Mentionable bool `db:"mentionable" json:"mentionable" description:"Whether the user is mentionable (for alerts in bot-logs etc.)"` DataHolder bool `` /* 194-byte string literal not displayed */ }
@ci table=team_members
Team Member represents a member of a team on Infinity List.
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."` Description string `json:"description" description:"The description 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"` EncKey pgtype.Text `db:"enc_key" json:"enc_key"` }
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"` Certified bool `db:"certified" json:"certified"` 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"` Staff bool `db:"-" json:"staff" ci:"internal"` // Must be handled internally 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 []BotPack `db:"-" json:"user_packs" description:"The list of packs the user has" ci:"internal"` // Must be handled internally CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the user was created"` UpdatedAt time.Time `db:"updated_at" json:"updated_at" description:"The time the user was last updated"` LastBoosterClaim *time.Time `db:"last_booster_claim" json:"last_booster_claim" description:"The last time the user claimed a booster reward"` }
@ci table=users ignore_fields=api_token
type UserEntityPerms ¶
type UserEntityPerms struct {
Perms []string `json:"perms" description:"The user's permissions on an entity"`
}
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 Staff bool `db:"-" json:"staff" ci:"internal"` // 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"` }
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 `` /* 237-byte string literal not displayed */ ValidVotes []EntityVote `json:"valid_votes" description:"A list of all non-voided votes the user has made on the entity"` VoteInfo *VoteInfo `json:"vote_info" description:"Some information about the vote"` Wait *VoteWait `json:"wait" description:"The time until the user can vote again"` }
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"` CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time the vanity was created"` }
type VoteCreditTier ¶
type VoteCreditTier struct { ID string `db:"id" json:"id" description:"The ID of the vote credit tier"` TargetType string `db:"target_type" json:"target_type" description:"The target type of the entity"` Position int `db:"position" json:"position" description:"The position of the vote credit tier"` Votes int `db:"votes" json:"votes" description:"The amount of votes the user needs to get this tier"` Cents int `db:"cents" json:"cents" description:"The amount of cents the user gets off in this tier"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
@ci table=vote_credit_tiers
VoteCreditTier represents a vote credit tier.
type VoteCreditTierRedeemSummary ¶
type VoteCreditTierRedeemSummary struct { Tiers []*VoteCreditTier `json:"tiers" description:"The vote credit tiers"` Votes int `json:"votes" description:"The amount of votes the entity has"` SlabOverview []int `json:"slab_overview" description:"Slab-based overview with each index, i, representing the amount of votes in Tiers[i]"` TotalCredits int `json:"total_credits" description:"The total amount of credits the user would get, in cents"` }
Represents a summary of what would happen on redeeming vote credit tiers
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"` VoteCredits bool `json:"vote_credits" description:"Whether or not the entity supports vote credits"` MultipleVotes bool `json:"multiple_votes" description:"Whether or not the entity supports multiple votes per time interval"` SupportsUpvotes bool `json:"supports_upvotes" description:"Whether or not the entity supports upvotes"` SupportsDownvotes bool `json:"supports_downvotes" description:"Whether or not the entity supports downvotes"` }
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 Webhook ¶
type Webhook struct { ID pgtype.UUID `db:"id" json:"id" description:"The bot's internal ID. An artifact of database migrations."` Name string `db:"name" json:"name" description:"The name of the webhook."` 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.)."` Url string `db:"url" json:"url" description:"The URL of the webhook."` Broken bool `db:"broken" json:"broken" description:"Whether the webhook is marked as broken or not."` FailedRequests int `db:"failed_requests" json:"failed_requests" description:"The number of failed requests to the webhook."` SimpleAuth bool `` /* 143-byte string literal not displayed */ EventWhitelist []string `` /* 155-byte string literal not displayed */ CreatedAt time.Time `db:"created_at" json:"created_at" description:"The time when the webhook was created."` }
@ci table=webhooks unfilled=1
Represents a webhook on IBL
type WebhookLogEntry ¶
type WebhookLogEntry struct { ID pgtype.UUID `db:"id" json:"id" description:"The ID of the webhook log."` WebhookID pgtype.UUID `db:"webhook_id" json:"webhook_id" description:"The ID of the webhook."` 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."` RequestHeaders map[string]any `db:"request_headers" json:"request_headers" description:"The headers of the webhook request."` ResponseHeaders map[string]any `db:"response_headers" json:"response_headers" description:"The headers of the webhook response."` }
@ci table=webhook_logs
Webhook log
type WebhookType ¶
type WebhookType = string
const ( WebhookTypeText WebhookType = "text" WebhookTypeTextArray WebhookType = "text[]" WebhookTypeLinkArray WebhookType = "link[]" WebhookTypeNumber WebhookType = "number" WebhookTypeChangeset WebhookType = "changeset" WebhookTypeBoolean WebhookType = "boolean" )