types

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WEBSITE_EmbedType = "Website"
	IMAGE_EmbedType   = "Image"
	VIDEO_EmbedType   = "Video"
	TEXT_EmbedType    = "Text"
)
View Source
const (
	NONE_MessageEmbedSpecialType       = "None"
	GIF_MessageEmbedSpecialType        = "GIF"
	YOUTUBE_MessageEmbedSpecialType    = "YouTube"
	LIGHTSPEED_MessageEmbedSpecialType = "Lightspeed"
	TWITCH_MessageEmbedSpecialType     = "Twitch"
	SPOTIFY_MessageEmbedSpecialType    = "Spotify"
	SOUNDCLOUD_MessageEmbedSpecialType = "Soundcloud"
	BANDCAMP_MessageEmbedSpecialType   = "Bandcamp"
	STREAMABLE_MessageEmbedSpecialType = "Streamable"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError map[string]any

API error, not properly generated

func (APIError) Type

func (e APIError) Type() string

type AccountInfo

type AccountInfo struct {
	Id    string `json:"_id"`
	Email string `json:"email"`
}

type AccountStrike

type AccountStrike struct {
	// Strike Id
	Id string `json:"_id"`
	// Id of reported user
	UserId string `json:"user_id"`
	// Attached reason
	Reason string `json:"reason"`
}

Account Strike on a user

type AllMemberResponse

type AllMemberResponse struct {
	// List of members
	Members []Member `json:"members"`
	// List of users
	Users []User `json:"users"`
}

Both lists are sorted by ID.

type BanListResult

type BanListResult struct {
	// Users objects
	Users []BannedUser `json:"users"`
	// Ban objects
	Bans []ServerBan `json:"bans"`
}

Result from querying list of bans

type BandcampType

type BandcampType string

BandcampType : Type of remote Bandcamp content

<currently unused?>

const (
	ALBUM_BandcampType BandcampType = "Album"
	TRACK_BandcampType BandcampType = "Track"
)

List of BandcampType

type BannedUser

type BannedUser struct {
	// Id of the banned user
	Id string `json:"_id"`
	// Username of the banned user
	Username string `json:"username"`
	// Avatar of the banned user
	Avatar *File `json:"avatar,omitempty"`
}

Just enoguh user information to list bans.

type Bot

type Bot struct {
	// Bot Id  This equals the associated bot user's id.
	Id string `json:"_id"`
	// User Id of the bot owner
	Owner string `json:"owner"`
	// Token used to authenticate requests for this bot
	Token string `json:"token"`
	// Whether the bot is public (may be invited by anyone)
	Public bool `json:"public"`
	// Whether to enable analytics
	Analytics bool `json:"analytics,omitempty"`
	// Whether this bot should be publicly discoverable
	Discoverable bool `json:"discoverable,omitempty"`
	// Reserved; URL for handling interactions
	InteractionsUrl string `json:"interactions_url,omitempty"`
	// URL for terms of service
	TermsOfServiceUrl string `json:"terms_of_service_url,omitempty"`
	// URL for privacy policy
	PrivacyPolicyUrl string `json:"privacy_policy_url,omitempty"`
	// Enum of bot flags
	Flags uint64 `json:"flags,omitempty"`
}

Representation of a bot on Revolt

type BotInformation

type BotInformation struct {
	// Id of the owner of this bot
	Owner string `json:"owner"`
}

Bot information for if the user is a bot

type Category

type Category struct {
	// Unique ID for this category
	Id string `json:"id"`
	// Title for this category
	Title string `json:"title"`
	// Channels in this category
	Channels []string `json:"channels"`
}

Channel category

type Channel

type Channel struct {
	Id                 string                              `json:"_id,omitempty"`
	ChannelType        ChannelType                         `json:"channel_type,omitempty"`
	UserId             string                              `json:"user,omitempty"`
	Nonce              string                              `json:"nonce,omitempty"`
	Active             bool                                `json:"active,omitempty"`
	Recipients         []string                            `json:"recipients,omitempty"`
	LastMessageID      string                              `json:"last_message_id,omitempty"`
	Name               string                              `json:"name,omitempty"`
	OwnerId            string                              `json:"owner,omitempty"`
	Description        string                              `json:"description,omitempty"`
	Icon               *File                               `json:"icon,omitempty"`
	DefaultPermissions *PermissionOverrideField            `json:"default_permissions,omitempty"`
	RolePermissions    map[string]*PermissionOverrideField `json:"role_permissions,omitempty"`
	Permissions        uint                                `json:"permissions,omitempty"`
	NSFW               bool                                `json:"nsfw,omitempty"`
}

Channel struct.

type ChannelList

type ChannelList []Channel

type ChannelType

type ChannelType string
const (
	TEXT_ChannelType  ChannelType = "Text"
	VOICE_ChannelType ChannelType = "Voice"
)

List of ChannelType

type ChannelUnreadId

type ChannelUnreadId struct {
	// Channel Id
	Channel string `json:"channel"`
	// User Id
	User string `json:"user"`
}

Composite key pointing to a user's view of a channel

type CollectionScans

type CollectionScans struct {
	// Number of total collection scans
	Total uint64 `json:"total"`
	// Number of total collection scans not using a tailable cursor
	NonTailable uint64 `json:"nonTailable"`
}

Query collection scan stats

type CollectionStats

type CollectionStats struct {
	// Namespace
	Ns string `json:"ns"`
	// Local time
	LocalTime timestamp.Timestamp `json:"localTime"`
	// Latency stats
	LatencyStats map[string]LatencyStats `json:"latencyStats"`
	// Query exec stats
	QueryExecStats *CollectionStatsQueryExecStats `json:"queryExecStats"`
	// Number of documents in collection
	Count uint64 `json:"count"`
}

Collection stats

type CollectionStatsQueryExecStats

type CollectionStatsQueryExecStats struct {
	// Stats regarding collection scans
	CollectionScans *CollectionScans `json:"collectionScans"`
}

Query exec stats

type ConfirmAccountDeletionResponse

type ConfirmAccountDeletionResponse struct {
	// Deletion token
	Token string `json:"token"`
}

Response to an account deletion confirmation request.

type ContentReportReason

type ContentReportReason string

ContentReportReason : Reason for reporting content (message or server)

const (
	NONE_SPECIFIED_ContentReportReason      ContentReportReason = "NoneSpecified"
	ILLEGAL_ContentReportReason             ContentReportReason = "Illegal"
	ILLEGAL_GOODS_ContentReportReason       ContentReportReason = "IllegalGoods"
	ILLEGAL_EXTORTION_ContentReportReason   ContentReportReason = "IllegalExtortion"
	ILLEGAL_PORNOGRAPHY_ContentReportReason ContentReportReason = "IllegalPornography"
	ILLEGAL_HACKING_ContentReportReason     ContentReportReason = "IllegalHacking"
	EXTREME_VIOLENCE_ContentReportReason    ContentReportReason = "ExtremeViolence"
	PROMOTES_HARM_ContentReportReason       ContentReportReason = "PromotesHarm"
	UNSOLICITED_SPAM_ContentReportReason    ContentReportReason = "UnsolicitedSpam"
	RAID_ContentReportReason                ContentReportReason = "Raid"
	SPAM_ABUSE_ContentReportReason          ContentReportReason = "SpamAbuse"
	SCAMS_FRAUD_ContentReportReason         ContentReportReason = "ScamsFraud"
	MALWARE_ContentReportReason             ContentReportReason = "Malware"
	HARASSMENT_ContentReportReason          ContentReportReason = "Harassment"
)

List of ContentReportReason

type CreateServerResponse

type CreateServerResponse struct {
	// Server object
	Server *Server `json:"server"`
	// Default channels
	Channels []Channel `json:"channels"`
}

Response from creating a server

type CreateVoiceUserResponse

type CreateVoiceUserResponse struct {
	// Token for authenticating with the voice server
	Token string `json:"token"`
}

Response from the 'Join Call' endpoint

type DataBanCreate

type DataBanCreate struct {
	// Ban reason
	Reason string `json:"reason,omitempty"`
}

Data needed to ban a user, note that all fields are optional

type DataChangeEmail

type DataChangeEmail struct {
	// Valid email address
	Email string `json:"email"`
	// Current password
	CurrentPassword string `json:"current_password"`
}

Data needed to change the email address.

type DataChangePassword

type DataChangePassword struct {
	// New password
	Password string `json:"password"`
	// Current password
	CurrentPassword string `json:"current_password"`
}

Data needed to change the password.

type DataChangeUsername

type DataChangeUsername struct {
	// New username
	Username string `json:"username"`
	// Current account password
	Password string `json:"password"`
}

type DataConfirmPasswordReset

type DataConfirmPasswordReset struct {
	// Reset token
	Token string `json:"token"`
	// New password
	Password string `json:"password"`
	// Whether to logout all sessions
	RemoveSessions bool `json:"remove_sessions,omitempty"`
}

Data needed to confirm password reset and change the password.

type DataCreateAccount

type DataCreateAccount struct {
	// Valid email address
	Email string `json:"email"`
	// Password
	Password string `json:"password"`
	// Invite code
	//
	// <optional, not all Revolt nodes need it>
	Invite string `json:"invite,omitempty"`
	// Captcha verification code
	//
	// <optional, not all Revolt nodes need it>
	Captcha string `json:"captcha,omitempty"`
}

Data needed to create a new account.

type DataCreateBot

type DataCreateBot struct {
	// Bot username
	Name string `json:"name"`
}

Data needed to create a bot

<unless specified, all fields are required>

type DataCreateChannel

type DataCreateChannel struct {
	// Channel type
	Type ChannelType `json:"type,omitempty"`
	// Channel name
	//
	// <this is required for creating a channel>
	Name string `json:"name,omitempty"`
	// Channel description
	Description string `json:"description,omitempty"`
	// Whether this channel is age restricted
	Nsfw bool `json:"nsfw,omitempty"`
}

Data for creating a channel

type DataCreateEmoji

type DataCreateEmoji struct {
	// Server name
	Name string `json:"name"`
	// Information about what owns this emoji
	Parent *EmojiParent `json:"parent"`
	// Whether the emoji is mature
	Nsfw bool `json:"nsfw,omitempty"`
}

type DataCreateGroup

type DataCreateGroup struct {
	// Group name
	Name string `json:"name"`
	// Group description
	Description string `json:"description,omitempty"`
	// Array of user IDs to add to the group.
	//
	// Must be friends with these users.
	Users []string `json:"users"`
	// Whether this group is age-restricted
	Nsfw bool `json:"nsfw,omitempty"`
}

Data for creating a group

type DataCreateRole

type DataCreateRole struct {
	// Role name
	Name string `json:"name"`
	// Ranking position  Smaller values take priority.
	Rank uint64 `json:"rank,omitempty"`
}

Data needed to create a role

type DataCreateServer

type DataCreateServer struct {
	// Server name
	Name string `json:"name"`
	// Server description
	Description string `json:"description,omitempty"`
	// Whether this server is age-restricted
	Nsfw bool `json:"nsfw,omitempty"`
}

Data to create a server

type DataCreateStrike

type DataCreateStrike struct {
	// Id of reported user
	UserId string `json:"user_id"`
	// Attached reason
	Reason string `json:"reason"`
}

New strike information

type DataCreateWebhook

type DataCreateWebhook struct {
	Name   string `json:"name"`
	Avatar string `json:"avatar,omitempty"`
}

Data for creating a webhook

type DataEditAccountStrike

type DataEditAccountStrike struct {
	// New attached reason
	Reason string `json:"reason"`
}

New strike information

type DataEditBot

type DataEditBot struct {
	// Bot username
	Name string `json:"name,omitempty"`
	// Whether the bot can be added by anyone
	Public bool `json:"public,omitempty"`
	// Whether analytics should be gathered for this bot  Must be enabled in order to show up on [Revolt Discover](https://rvlt.gg).
	Analytics bool `json:"analytics,omitempty"`
	// Interactions URL
	InteractionsUrl string `json:"interactions_url,omitempty"`
	// Fields to remove from bot object
	Remove []FieldsBot `json:"remove,omitempty"`
}

Data needed to edit a bot

type DataEditChannel

type DataEditChannel struct {
	// Channel name
	Name string `json:"name,omitempty"`
	// Channel description
	Description string `json:"description,omitempty"`
	// Group owner
	Owner string `json:"owner,omitempty"`
	// Icon  Provide an Autumn attachment Id.
	Icon string `json:"icon,omitempty"`
	// Whether this channel is age-restricted
	Nsfw bool `json:"nsfw,omitempty"`
	// Whether this channel is archived
	Archived bool `json:"archived,omitempty"`
	// Fields to remove from the channel
	Remove []FieldsChannel `json:"remove,omitempty"`
}

Data for editing a channel

type DataEditReport

type DataEditReport struct {
	// New report status
	Status *ReportStatus `json:"status,omitempty"`
	// Report notes
	Notes string `json:"notes,omitempty"`
}

type DataEditRole

type DataEditRole struct {
	// Role name
	Name string `json:"name,omitempty"`
	// Role colour
	Colour string `json:"colour,omitempty"`
	// Whether this role should be displayed separately
	Hoist bool `json:"hoist,omitempty"`
	// Ranking position  Smaller values take priority.
	Rank uint64 `json:"rank,omitempty"`
	// Fields to remove from role object
	Remove []FieldsRole `json:"remove,omitempty"`
}

Data needed to edit a role

type DataEditServer

type DataEditServer struct {
	// Server name
	Name string `json:"name,omitempty"`
	// Server description
	Description string `json:"description,omitempty"`
	// Attachment Id for icon
	Icon string `json:"icon,omitempty"`
	// Attachment Id for banner
	Banner string `json:"banner,omitempty"`
	// Category structure for server
	Categories []Category `json:"categories,omitempty"`
	// System message configuration
	SystemMessages *SystemMessageChannels `json:"system_messages,omitempty"`
	// Bitfield of server flags
	Flags uint64 `json:"flags,omitempty"`
	// Whether this server is public and should show up on [Revolt Discover](https://rvlt.gg)
	Discoverable bool `json:"discoverable,omitempty"`
	// Whether analytics should be collected for this server  Must be enabled in order to show up on [Revolt Discover](https://rvlt.gg).
	Analytics bool `json:"analytics,omitempty"`
	// Fields to remove from server object
	Remove []FieldsServer `json:"remove,omitempty"`
}

Data to edit a server

type DataEditSession

type DataEditSession struct {
	// Session friendly name
	FriendlyName string `json:"friendly_name"`
}

type DataEditUser

type DataEditUser struct {
	// New display name
	DisplayName string `json:"display_name,omitempty"`
	// Attachment Id for avatar
	Avatar string `json:"avatar,omitempty"`
	// New user status
	Status *UserStatus `json:"status,omitempty"`
	// New user profile data  This is applied as a partial.
	Profile *DataEditUserProfile `json:"profile,omitempty"`
	// Bitfield of user badges
	Badges uint64 `json:"badges,omitempty"`
	// Enum of user flags
	Flags uint64 `json:"flags,omitempty"`
	// Fields to remove from user object
	Remove []FieldsUser `json:"remove,omitempty"`
}

type DataEditUserProfile

type DataEditUserProfile struct {
	// Text to set as user profile description
	Content string `json:"content,omitempty"`
	// Attachment Id for background
	Background string `json:"background,omitempty"`
}

New user profile data This is applied as a partial.

type DataFetchSettings

type DataFetchSettings struct {
	// Keys to fetch
	Keys []string `json:"keys"`
}

Fetch settings from server filtered by keys.

type DataHello

type DataHello struct {
	// Whether onboarding is required
	Onboarding bool `json:"onboarding"`
}

This will tell you whether the current account requires onboarding or whether you can continue to send requests as usual.

You may skip calling this if you're restoring an existing session.

type DataInviteBot

type DataInviteBot struct {
	// Server Id
	Server string `json:"server,omitempty"`
	// Group id
	Group string `json:"group,omitempty"`
}

Data needed to invite a bot to a server or group

<official docs seem to miss server but its there>

type DataLogin

type DataLogin struct {

	// Email
	Email string `json:"email,omitempty"`

	// Password
	Password string `json:"password,omitempty"`

	// Unvalidated or authorised MFA ticket
	//
	// Used to resolve the correct account
	MfaTicket string `json:"mfa_ticket,omitempty"`

	// MFA response
	MfaResponse *DataLoginMfaResponse `json:"mfa_response,omitempty"`
}

type DataLoginMfaResponse

type DataLoginMfaResponse struct {
	// Password
	Password string `json:"password,omitempty"`
	// Recovery Code
	RecoveryCode string `json:"recovery_code,omitempty"`
	// TOTP code
	TotpCode string `json:"totp_code,omitempty"`
}

Note, you must specify one (and only one) of the following fields if specifiying this

type DataMemberEdit

type DataMemberEdit struct {
	// Member nickname
	Nickname string `json:"nickname,omitempty"`
	// Attachment Id to set for avatar
	Avatar string `json:"avatar,omitempty"`
	// Array of role ids
	Roles []string `json:"roles,omitempty"`
	// Timestamp this member is timed out until
	Timeout timestamp.Timestamp `json:"timeout,omitempty"`
	// Fields to remove from channel object
	Remove []FieldsMember `json:"remove,omitempty"`
}

Member object

type DataMessageEdit

type DataMessageEdit struct {
	// New message content
	Content string `json:"content,omitempty"`
	// Embeds to include in the message
	Embeds []SendableEmbed `json:"embeds,omitempty"`
}

This struct is data needed to edit a message.

type DataMessageSend

type DataMessageSend struct {
	// Unique token to prevent duplicate message sending  **This is deprecated and replaced by `Idempotency-Key`!**
	Nonce string `json:"nonce,omitempty"`
	// Message content to send
	Content string `json:"content,omitempty"`
	// Attachments to include in message
	Attachments []string `json:"attachments,omitempty"`
	// Messages to reply to
	Replies []Reply `json:"replies,omitempty"`
	// Embeds to include in message  Text embed content contributes to the content length cap
	Embeds []SendableEmbed `json:"embeds,omitempty"`
	// Masquerade to apply to this message
	Masquerade *MessageMasquerade `json:"masquerade,omitempty"`
	// Information about how this message should be interacted with
	Interactions *MessageInteractions `json:"interactions,omitempty"`
}

Message : A message sent in a channel

This struct is data needed to send a message.

type DataOnboard

type DataOnboard struct {
	// New username which will be used to identify the user on the platform
	Username string `json:"username"`
}

This sets a new username, completes onboarding and allows a user to start using Revolt.

type DataReactionsRemove

type DataReactionsRemove struct {
	// Remove a specific user's reaction
	UserId string `json:"user_id,omitempty"`

	// Remove all reactions
	RemoveAll bool `json:"remove_all,omitempty"`
}

type DataReportContent

type DataReportContent struct {
	// Content being reported
	Content *DataReportContentContent `json:"content"`
	// Additional report description
	AdditionalContext string `json:"additional_context,omitempty"`
}

Additional report description

type DataReportContentContent

type DataReportContentContent struct {
	// Type of content being reported, either Message, Server or User
	Type string `json:"type"`
	// ID of the message/server/user being reported
	//
	// <this is mandatory for all types>
	Id string `json:"id"`
	// Reason for reporting this message/server/user
	//
	// <this is mandatory for all types>
	ReportReason string `json:"report_reason"`
	// Message context (only is Type is Message)
	MessageId string `json:"message_id,omitempty"`
}

The content being reported

type DataResendVerificationSendPasswordReset

type DataResendVerificationSendPasswordReset struct {
	// Email associated with the account
	Email string `json:"email"`
	// Captcha verification code
	Captcha string `json:"captcha,omitempty"`
}

Data needed to resend verification email or send password reset email.

type DataSendFriendRequest

type DataSendFriendRequest struct {
	// Username and discriminator combo separated by #
	Username string `json:"username"`
}

type DataSendPasswordReset

type DataSendPasswordReset struct {
	// Email associated with the account
	Email string `json:"email"`
	// Captcha verification code
	Captcha string `json:"captcha,omitempty"`
}

Data needed to send a password reset email.

type DataVerifyEmail

type DataVerifyEmail struct {
	// Multi-factor auth ticket
	Ticket *MfaTicket `json:"ticket"`
}

Data needed to verify an email

type EmbedType

type EmbedType string

Type of embed

type Emoji

type Emoji struct {
	// Unique Id
	Id string `json:"_id"`
	// What owns this emoji
	Parent *EmojiParent `json:"parent"`
	// Uploader user id
	CreatorId string `json:"creator_id"`
	// Emoji name
	Name string `json:"name"`
	// Whether the emoji is animated
	Animated bool `json:"animated,omitempty"`
	// Whether the emoji is marked as nsfw
	Nsfw bool `json:"nsfw,omitempty"`
}

Representation of an Emoji on Revolt

type EmojiParent

type EmojiParent struct {
	// Type of emoji, either Server for server emoji or detached
	Type string `json:"type"`
	// ID of the server this emoji belongs to, if type is Server
	Id string `json:"id,omitempty"`
}

type FetchBotResponse

type FetchBotResponse struct {
	// Bot object
	Bot *Bot `json:"bot"`
	// User object
	User *User `json:"user"`
}

Bot Response

type FieldsBot

type FieldsBot string

FieldsBot : Optional fields on bot object

const (
	TOKEN_FieldsBot            FieldsBot = "Token"
	INTERACTIONS_URL_FieldsBot FieldsBot = "InteractionsURL"
)

List of FieldsBot

type FieldsChannel

type FieldsChannel string

FieldsChannel : Optional fields on channel object

const (
	DESCRIPTION_FieldsChannel         FieldsChannel = "Description"
	ICON_FieldsChannel                FieldsChannel = "Icon"
	DEFAULT_PERMISSIONS_FieldsChannel FieldsChannel = "DefaultPermissions"
)

List of FieldsChannel

type FieldsMember

type FieldsMember string

FieldsMember : Optional fields on server member object

const (
	NICKNAME_FieldsMember FieldsMember = "Nickname"
	AVATAR_FieldsMember   FieldsMember = "Avatar"
	ROLES_FieldsMember    FieldsMember = "Roles"
	TIMEOUT_FieldsMember  FieldsMember = "Timeout"
)

List of FieldsMember

type FieldsRole

type FieldsRole string

FieldsRole : Optional fields on server object

const (
	COLOUR_FieldsRole FieldsRole = "Colour"
)

List of FieldsRole

type FieldsServer

type FieldsServer string

FieldsServer : Optional fields on server object

const (
	DESCRIPTION_FieldsServer     FieldsServer = "Description"
	CATEGORIES_FieldsServer      FieldsServer = "Categories"
	SYSTEM_MESSAGES_FieldsServer FieldsServer = "SystemMessages"
	ICON_FieldsServer            FieldsServer = "Icon"
)

List of FieldsServer

type FieldsUser

type FieldsUser string

FieldsUser : Optional fields on user object

const (
	AVATAR_FieldsUser             FieldsUser = "Avatar"
	STATUS_TEXT_FieldsUser        FieldsUser = "StatusText"
	STATUS_PRESENCE_FieldsUser    FieldsUser = "StatusPresence"
	PROFILE_CONTENT_FieldsUser    FieldsUser = "ProfileContent"
	PROFILE_BACKGROUND_FieldsUser FieldsUser = "ProfileBackground"
	DISPLAY_NAME_FieldsUser       FieldsUser = "DisplayName"
)

List of FieldsUser

type FieldsWebhook

type FieldsWebhook string

FieldsWebhook : Optional fields on webhook object

<undocumented, from https://github.com/revoltchat/backend/blob/master/crates/core/database/src/models/channel_webhooks/ops/mongodb.rs#L71>

const (
	AVATAR_FieldsWebhook FieldsWebhook = "Avatar"
)

type File

type File struct {
	// Unique Id
	Id string `json:"_id"`
	// Tag / bucket this file was uploaded to
	Tag string `json:"tag"`
	// Original filename
	Filename string `json:"filename"`
	// Parsed metadata of this file
	Metadata *FileMetadata `json:"metadata"`
	// Raw content type of this file
	ContentType string `json:"content_type"`
	// Size of this file (in bytes)
	Size uint64 `json:"size"`
	// Whether this file was deleted
	Deleted bool `json:"deleted,omitempty"`
	// Whether this file was reported
	Reported bool `json:"reported,omitempty"`
	// Message Id this file is associated with
	MessageId string `json:"message_id,omitempty"`
	// User Id this file is associated with
	UserId string `json:"user_id,omitempty"`
	// Server Id this file is associated with
	ServerId string `json:"server_id,omitempty"`
	// Id of the object this file is associated with
	ObjectId string `json:"object_id,omitempty"`
}

Representation of a File on Revolt Generated by Autumn

type FileMetadata

type FileMetadata struct {
	// Type of this file
	Type string `json:"type"`

	// Width of the video
	Width int `json:"width"`

	// Height of the video
	Height int `json:"height"`
}

type FullInvite

type FullInvite struct {
	// The type of the invite
	Type InviteType `json:"type,omitempty"`

	// Invite code
	Code string `json:"code,omitempty"`

	// Id of the server
	ServerId string `json:"server_id,omitempty"`

	// Name of the server
	ServerName string `json:"server_name,omitempty"`

	// Representation of a File on Revolt Generated by Autumn
	//
	// <this is the icon of the server>
	ServerIcon *File `json:"server_icon,omitempty"`

	// Representation of a File on Revolt Generated by Autumn
	//
	// <this is the banner of the server>
	ServerBanner *File `json:"server_banner,omitempty"`

	// Enum of server flags
	ServerFlags int64 `json:"server_flags,omitempty"`

	// Id of server channel
	ChannelId string `json:"channel_id,omitempty"`

	// Name of server channel
	ChannelName string `json:"channel_name,omitempty"`

	// Description of server channel
	ChannelDescription string `json:"channel_description,omitempty"`

	// Name of user who created the invite
	Username string `json:"user_name,omitempty"`

	// Representation of a File on Revolt Generated by Autumn
	//
	// <this is the avatar of the user who created the invite>
	UserAvatar *File `json:"user_avatar,omitempty"`

	// Number of members in this server
	MemberCount int64 `json:"member_count,omitempty"`
}

type ImageSize

type ImageSize string

ImageSize : Image positioning and size

<currently unused?>

const (
	LARGE_ImageSize   ImageSize = "Large"
	PREVIEW_ImageSize ImageSize = "Preview"
)

List of ImageSize

type Index

type Index struct {
	// Index name
	Name string `json:"name"`
	// Access information
	Accesses *IndexAccesses `json:"accesses"`
}

Collection index

type IndexAccesses

type IndexAccesses struct {
	// Operations since timestamp
	Ops uint64 `json:"ops"`
	// Timestamp at which data keeping begun
	Since timestamp.Timestamp `json:"since"`
}

Access information

type Invite

type Invite struct {
	// The Id of the invite
	Id string `json:"_id,omitempty"`

	// The type of the invite
	Type InviteType `json:"type,omitempty"`

	// The creator of the invite
	Creator string `json:"creator,omitempty"`

	// The channel the invite is for
	Channel string `json:"channel,omitempty"`

	// The server the invite points to if it is a server invite
	Server string `json:"server,omitempty"`
}

Representation of an created invite on Revolt

type InviteType

type InviteType string

InviteType : The type of an invite

const (
	GROUP_InviteType  InviteType = "Group"
	SERVER_InviteType InviteType = "Server"
)

type LatencyHistogramEntry

type LatencyHistogramEntry struct {
	// Time
	Micros uint64 `json:"micros"`
	// Count
	Count uint64 `json:"count"`
}

Histogram entry

type LatencyStats

type LatencyStats struct {
	// Total operations
	Ops uint64 `json:"ops"`
	// Timestamp at which data keeping begun
	Latency uint64 `json:"latency"`
	// Histogram representation of latency data
	Histogram []LatencyHistogramEntry `json:"histogram"`
}

Collection latency stats

type LightspeedType

type LightspeedType string

LightspeedType : Type of remote Lightspeed.tv content

<currently unused?>

const (
	CHANNEL_LightspeedType LightspeedType = "Channel"
)

List of LightspeedType

type Member

type Member struct {
	// Unique member id
	Id *MemberId `json:"_id"`
	// Time at which this user joined the server
	JoinedAt timestamp.Timestamp `json:"joined_at,omitempty"`
	// Member's nickname
	Nickname string `json:"nickname,omitempty"`
	// Avatar attachment
	Avatar *File `json:"avatar,omitempty"`
	// Member's roles
	Roles []string `json:"roles,omitempty"`
	// Timestamp this member is timed out until
	Timeout timestamp.Timestamp `json:"timeout,omitempty"`
}

Representation of a member of a server on Revolt

type MemberId

type MemberId struct {
	// Server Id
	Server string `json:"server"`
	// User Id
	User string `json:"user"`
}

Unique member id

<this is a composite primary key consisting of server and user id>

type MemberQueryResponse

type MemberQueryResponse struct {
	// List of members
	Members []Member `json:"members"`
	// List of users
	Users []User `json:"users"`
}

Member Query Response

TODO: Provide better docs on what this is

type Message

type Message struct {
	// Unique Id
	Id string `json:"_id"`
	// Unique value generated by client sending this message
	Nonce string `json:"nonce,omitempty"`
	// Id of the channel this message was sent in
	Channel string `json:"channel"`
	// Id of the user or webhook that sent this message
	Author string `json:"author"`
	// The webhook that sent this message
	Webhook *MessageWebhook `json:"webhook,omitempty"`
	// Message content
	Content string `json:"content,omitempty"`
	// System message
	System *MessageSystem `json:"system,omitempty"`
	// Array of attachments
	Attachments []*File `json:"attachments,omitempty"`
	// Time at which this message was last edited
	Edited timestamp.Timestamp `json:"edited,omitempty"`
	// Attached embeds to this message
	Embeds []*MessageEmbed `json:"embeds,omitempty"`
	// Array of user ids mentioned in this message
	Mentions []string `json:"mentions,omitempty"`
	// Array of message ids this message is replying to
	Replies []string `json:"replies,omitempty"`
	// Hashmap of emoji IDs to array of user IDs
	Reactions map[string][]string `json:"reactions,omitempty"`
	// Information about how this message should be interacted with
	Interactions *MessageInteractions `json:"interactions,omitempty"`
	// Name and / or avatar overrides for this message
	Masquerade *MessageMasquerade `json:"masquerade,omitempty"`
}

Representation of a Message on Revolt

type MessageEmbed

type MessageEmbed struct {
	// Type of embed
	Type EmbedType `json:"type,omitempty"`
	// Only on Text embeds, the embeds icon url
	IconUrl string `json:"icon_url,omitempty"`
	// Available on most embed types, the url of the embed
	Url string `json:"url,omitempty"`
	// Only sent on Website embeds, the original url of the embed
	OriginalUrl string `json:"original_url,omitempty"`
	// Any special remote content, only sent on Website embeds
	Special *MessageEmbedSpecial `json:"special,omitempty"`
	// Sent on all event types other than Video/Image embeds (?)
	Title string `json:"title,omitempty"`
	// Sent on all event types other than Video/Image embeds (?)
	Description string `json:"description,omitempty"`
	// Image of the website. Only sent on Website embeds
	Image *MessageEmbedImage `json:"image,omitempty"`
	// Video embed of the website. Only sent on Website embeds
	Video *MessageEmbedVideo `json:"video,omitempty"`
	// Site name, only sent on Website embeds
	SiteName string `json:"site_name,omitempty"`
	// ID of uploaded autumn file
	//
	// <does not appear to be sent at this time, may be sent in the future>
	Media *File `json:"media,omitempty"`
	// Colour of the embed (CSS colour)
	Colour string `json:"colour,omitempty"`
}

Representation of an message embed on Revolt.

type MessageEmbedImage

type MessageEmbedImage struct {
	// Size of the image
	Size string `json:"size"`

	// URL of the image
	URL string `json:"url"`

	// Width of the image
	Width int `json:"width"`

	// Height of the image
	Height int `json:"height"`
}

type MessageEmbedSpecial

type MessageEmbedSpecial struct {
	Type MessageEmbedSpecialType `json:"type,omitempty"`

	// The ID of the content on the remote service
	ID string `json:"id,omitempty"`

	// The title of the content
	Timestamp time.Time `json:"timestamp,omitempty"`

	// Identifies the type of content for types: Lightspeed, Twitch, Spotify, and Bandcamp
	ContentType string `json:"content_type,omitempty"`
}

type MessageEmbedSpecialType

type MessageEmbedSpecialType string

Type of special embed content (remote content)

type MessageEmbedVideo

type MessageEmbedVideo struct {
	// URL to the original video
	Url string `json:"url"`

	// Width of the video
	Width int `json:"width"`

	// Height of the video
	Height int `json:"height"`
}

type MessageFetchResponse

type MessageFetchResponse struct {
	// Whether to include user (and member, if server channel) objects, used internally by MarshalJSON/UnmarshalJSON
	IncludeUsers bool

	// List of messages
	Messages []*Message `json:"messages,omitempty"`

	// List of users, only set if IncludeUsers is true
	Users []*User `json:"users,omitempty"`

	// List of members, only set if IncludeUsers is true
	Members []*Member `json:"members,omitempty"`
}

Note that this struct is used for both include_users and no_include_users

func (*MessageFetchResponse) MarshalJSON

func (m *MessageFetchResponse) MarshalJSON() ([]byte, error)

func (*MessageFetchResponse) UnmarshalJSON

func (m *MessageFetchResponse) UnmarshalJSON(data []byte) error

type MessageIds

type MessageIds struct {
	// Message IDs
	Ids []string `json:"ids"`
}

type MessageInteractions

type MessageInteractions struct {
	// Reactions which should always appear and be distinct
	Reactions []string `json:"reactions,omitempty"`
	// Whether reactions should be restricted to the given list  Can only be set to true if reactions list is of at least length 1
	RestrictReactions bool `json:"restrict_reactions,omitempty"`
}

Information to guide interactions on this message

type MessageMasquerade

type MessageMasquerade struct {
	// Replace the display name shown on this message
	Name string `json:"name,omitempty"`
	// Replace the avatar shown on this message (URL to image file)
	Avatar string `json:"avatar,omitempty"`
	// Replace the display role colour shown on this message  Must have `ManageRole` permission to use
	Colour string `json:"colour,omitempty"`
}

Name and / or avatar overrides for this message

type MessageQuery

type MessageQuery struct {
	// Maximum number of messages to fetch
	//
	// For fetching nearby messages, this is `(limit + 1)`.
	Limit uint64 `json:"limit,omitempty"`

	// Message id before which messages should be fetched
	Before string `json:"before,omitempty"`

	// Message id after which messages should be fetched
	After string `json:"after,omitempty"`

	// Message sort direction
	Sort MessageSort `json:"sort,omitempty"`

	// Message id to search around
	//
	// Specifying 'nearby' ignores 'before', 'after' and 'sort'.
	// It will also take half of limit rounded as the limits to each side.
	// It also fetches the message ID specified.
	Nearby string `json:"nearby,omitempty"`

	// Whether to include user (and member, if server channel) objects
	IncludeUsers bool `json:"include_users,omitempty"`
}

Filter and sort messages by time

type MessageSearchQuery

type MessageSearchQuery struct {
	// Full-text search query
	//
	// See MongoDB documentation for more information.
	//
	// <https://docs.mongodb.com/manual/text-search/#-text-operator>
	//
	// <Mandatory>
	Query string `json:"query"`

	// Maximum number of messages to fetch
	//
	// For fetching nearby messages, this is `(limit + 1)`.
	Limit uint64 `json:"limit,omitempty"`

	// Message id before which messages should be fetched
	Before string `json:"before,omitempty"`

	// Message id after which messages should be fetched
	After string `json:"after,omitempty"`

	// Message sort direction
	Sort MessageSort `json:"sort,omitempty"`

	// Whether to include user (and member, if server channel) objects
	IncludeUsers bool `json:"include_users"`
}

Filter and sort messages

type MessageSort

type MessageSort string

MessageSort : Sort used for retrieving messages

const (
	RELEVANCE_MessageSort MessageSort = "Relevance"
	LATEST_MessageSort    MessageSort = "Latest"
	OLDEST_MessageSort    MessageSort = "Oldest"
)

List of MessageSort

type MessageSystem

type MessageSystem struct {
	// System message type
	Type string `json:"type"`

	// System message content
	Content string `json:"content"`
}

System message

type MessageWebhook

type MessageWebhook struct {
	Name   string `json:"name"`
	Avatar string `json:"avatar,omitempty"`
}

Information about the webhook bundled with Message

type MfaMethod

type MfaMethod string

MfaMethod : MFA method

const (
	PASSWORD_MfaMethod MfaMethod = "Password"
	RECOVERY_MfaMethod MfaMethod = "Recovery"
	TOTP_MfaMethod     MfaMethod = "Totp"
)

List of MFAMethod

type MfaTicket

type MfaTicket struct {
	// Unique Id
	Id string `json:"_id"`
	// Account Id
	AccountId string `json:"account_id"`
	// Unique Token
	Token string `json:"token"`
	// Whether this ticket has been validated (can be used for account actions)
	Validated bool `json:"validated"`
	// Whether this ticket is authorised (can be used to log a user in)
	Authorised bool `json:"authorised"`
	// TOTP code at time of ticket creation
	LastTotpCode string `json:"last_totp_code,omitempty"`
}

Multi-factor auth ticket

type MultiFactorStatus

type MultiFactorStatus struct {
	EmailOtp        bool `json:"email_otp"`
	TrustedHandover bool `json:"trusted_handover"`
	EmailMfa        bool `json:"email_mfa"`
	TotpMfa         bool `json:"totp_mfa"`
	SecurityKeyMfa  bool `json:"security_key_mfa"`
	RecoveryActive  bool `json:"recovery_active"`
}

type MutualResponse

type MutualResponse struct {
	// Array of mutual user IDs that both users are friends with
	Users []string `json:"users"`
	// Array of mutual server IDs that both users are in
	Servers []string `json:"servers"`
}

type NewRoleResponse

type NewRoleResponse struct {
	// Id of the role
	Id string `json:"id"`
	// New role
	Role *Role `json:"role"`
}

Response upon creating a role

type OwnedBotsResponse

type OwnedBotsResponse struct {
	// Bot objects
	Bots []Bot `json:"bots"`
	// User objects
	Users []User `json:"users"`
}

Both lists are sorted by their IDs.

type PermissionOverride

type PermissionOverride struct {
	// Allow bit flags
	Allow uint64 `json:"allow"`
	// Disallow bit flags
	Deny uint64 `json:"deny"`
}

Representation of a single permission override

type PermissionOverrideField

type PermissionOverrideField struct {
	// Allow bit flags
	A uint64 `json:"a"`
	// Disallow bit flags
	D uint64 `json:"d"`
}

Representation of a single permission override as it appears on models and in the database

type PermissionsPatchOverrideField

type PermissionsPatchOverrideField struct {
	Permissions *PermissionOverride `json:"permissions"`
}

type Presence

type Presence string

Presence : Presence status

const (
	ONLINE_Presence    Presence = "Online"
	IDLE_Presence      Presence = "Idle"
	FOCUS_Presence     Presence = "Focus"
	BUSY_Presence      Presence = "Busy"
	INVISIBLE_Presence Presence = "Invisible"
)

List of Presence

type PublicBot

type PublicBot struct {
	// Bot Id
	Id string `json:"_id"`
	// Bot Username
	Username string `json:"username"`
	// Profile Avatar
	Avatar string `json:"avatar"`
	// Profile Description
	Description string `json:"description"`
}

Public Bot

type RateLimit

type RateLimit struct {
	RetryAfter int64 `json:"retry_after"`
}

Rate limit struct

type Relationship

type Relationship struct {
	Id     string              `json:"_id"`
	Status *RelationshipStatus `json:"status"`
}

Relationship entry indicating current status with other user

type RelationshipStatus

type RelationshipStatus string

RelationshipStatus : User's relationship with another user (or themselves)

const (
	NONE_RelationshipStatus          RelationshipStatus = "None"
	USER_RelationshipStatus          RelationshipStatus = "User"
	FRIEND_RelationshipStatus        RelationshipStatus = "Friend"
	OUTGOING_RelationshipStatus      RelationshipStatus = "Outgoing"
	INCOMING_RelationshipStatus      RelationshipStatus = "Incoming"
	BLOCKED_RelationshipStatus       RelationshipStatus = "Blocked"
	BLOCKED_OTHER_RelationshipStatus RelationshipStatus = "BlockedOther"
)

List of RelationshipStatus

type Reply

type Reply struct {
	// Message Id
	Id string `json:"id"`
	// Whether this reply should mention the message's author
	Mention bool `json:"mention"`
}

Representation of a message reply before it is sent.

type Report

type Report struct {
	// Unique Id
	Id string `json:"_id"`
	// Id of the user creating this report
	AuthorId string `json:"author_id"`
	// Reported content
	Content string `json:"content"`
	// Additional report context
	AdditionalContext string `json:"additional_context"`
	// Additional notes included on the report
	Notes string `json:"notes,omitempty"`
	// Status of the report
	Status *ReportStatus `json:"status"`
}

User-generated platform moderation report.

type ReportStatus

type ReportStatus struct {
	Status string `json:"status"`

	// If status is Rejected, this is the reason
	RejectionReason string `json:"rejection_reason,omitempty"`

	// If status is Resolved/Rejected, this is when it was closed
	ClosedAt timestamp.Timestamp `json:"closed_at,omitempty"`
}

Status of the report

type ReportStatusString

type ReportStatusString string

ReportStatusString : Just the status of the report

const (
	CREATED_ReportStatusString  ReportStatusString = "Created"
	REJECTED_ReportStatusString ReportStatusString = "Rejected"
	RESOLVED_ReportStatusString ReportStatusString = "Resolved"
)

List of ReportStatusString

type ResponseTotpSecret

type ResponseTotpSecret struct {
	Secret string `json:"secret"`
}

type RevoltConfig

type RevoltConfig struct {
	// Revolt API Version
	Revolt string `json:"revolt"`
	// Features enabled on this Revolt node
	Features *RevoltFeatures `json:"features"`
	// WebSocket URL
	Ws string `json:"ws"`
	// URL pointing to the client serving this node
	App string `json:"app"`
	// Web Push VAPID public key
	Vapid string `json:"vapid"`
	// Build information
	Build *RevoltConfigBuild `json:"build"`
}

Revolt API configuration

type RevoltConfigBuild

type RevoltConfigBuild struct {
	// Commit Hash
	CommitSha string `json:"commit_sha"`
	// Commit Timestamp
	CommitTimestamp string `json:"commit_timestamp"`
	// Git Semver
	Semver string `json:"semver"`
	// Git Origin URL
	OriginUrl string `json:"origin_url"`
	// Build Timestamp
	Timestamp string `json:"timestamp"`
}

Build information

type RevoltFeatures

type RevoltFeatures struct {
	// hCaptcha configuration
	Captcha *RevoltFeaturesCaptcha `json:"captcha"`
	// Whether email verification is enabled
	Email bool `json:"email"`
	// Whether this server is invite only
	InviteOnly bool `json:"invite_only"`
	// File server service configuration
	Autumn *RevoltFeaturesAutumn `json:"autumn"`
	// Proxy service configuration
	January *RevoltFeaturesJanuary `json:"january"`
	// Voice server configuration
	Voso *RevoltFeaturesVoso `json:"voso"`
}

Features enabled on this Revolt node

type RevoltFeaturesAutumn

type RevoltFeaturesAutumn struct {
	// Whether the service is enabled
	Enabled bool `json:"enabled"`
	// URL pointing to the service
	Url string `json:"url"`
}

File server service configuration

type RevoltFeaturesCaptcha

type RevoltFeaturesCaptcha struct {
	// Whether captcha is enabled
	Enabled bool `json:"enabled"`
	// Client key used for solving captcha
	Key string `json:"key"`
}

hCaptcha configuration

type RevoltFeaturesJanuary

type RevoltFeaturesJanuary struct {
	// Whether the service is enabled
	Enabled bool `json:"enabled"`
	// URL pointing to the service
	Url string `json:"url"`
}

Proxy service configuration

type RevoltFeaturesVoso

type RevoltFeaturesVoso struct {
	// Whether voice is enabled
	Enabled bool `json:"enabled"`
	// URL pointing to the voice API
	Url string `json:"url"`
	// URL pointing to the voice WebSocket server
	Ws string `json:"ws"`
}

Voice server configuration

type Role

type Role struct {
	// Role name
	Name string `json:"name"`
	// Permissions available to this role
	Permissions *PermissionOverrideField `json:"permissions"`
	// Colour used for this role  This can be any valid CSS colour
	Colour string `json:"colour,omitempty"`
	// Whether this role should be shown separately on the member sidebar
	Hoist bool `json:"hoist,omitempty"`
	// Ranking of this role
	Rank uint64 `json:"rank,omitempty"`
}

Representation of a server role

type SendableEmbed

type SendableEmbed struct {
	IconUrl     string `json:"icon_url,omitempty"`
	Url         string `json:"url,omitempty"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Media       string `json:"media,omitempty"`
	Colour      string `json:"colour,omitempty"`
}

Representation of a text embed before it is sent.

type Server

type Server struct {
	// Unique Id
	Id string `json:"_id"`
	// User id of the owner
	Owner string `json:"owner"`
	// Name of the server
	Name string `json:"name"`
	// Description for the server
	Description string `json:"description,omitempty"`
	// Channels within this server
	Channels []string `json:"channels"`
	// Categories for this server
	Categories []Category `json:"categories,omitempty"`
	// Configuration for sending system event messages
	SystemMessages *SystemMessageChannels `json:"system_messages,omitempty"`
	// Roles for this server
	Roles map[string]Role `json:"roles,omitempty"`
	// Default set of server and channel permissions
	DefaultPermissions uint64 `json:"default_permissions"`
	// Icon attachment
	Icon *File `json:"icon,omitempty"`
	// Banner attachment
	Banner *File `json:"banner,omitempty"`
	// Bitfield of server flags
	Flags uint64 `json:"flags,omitempty"`
	// Whether this server is flagged as not safe for work
	Nsfw bool `json:"nsfw,omitempty"`
	// Whether to enable analytics
	Analytics bool `json:"analytics,omitempty"`
	// Whether this server should be publicly discoverable
	Discoverable bool `json:"discoverable,omitempty"`
}

Representation of a server on Revolt

type ServerBan

type ServerBan struct {
	// Unique member id
	Id *ServerBanId `json:"_id"`
	// Reason for ban creation
	Reason string `json:"reason,omitempty"`
}

Representation of a server ban on Revolt

type ServerBanId

type ServerBanId struct {
	// Server Id
	Server string `json:"server"`
	// User Id
	User string `json:"user"`
}

Unique member id

type SessionInfo

type SessionInfo struct {
	Id   string `json:"_id"`
	Name string `json:"name"`
}

Representation of a session on Revolt

type SnapshotContent

type SnapshotContent struct {
	Type string `json:"_type"`

	// If type is Message
	Message *SnapshotMessage `json:"message,omitempty"`

	// If type is Server
	Server *Server `json:"server,omitempty"`

	// If type is User
	User *User `json:"user,omitempty"`
}

func (*SnapshotContent) MarshalJSON

func (s *SnapshotContent) MarshalJSON() ([]byte, error)

Special function for encoding snapshot content

func (*SnapshotContent) UnmarshalJSON

func (s *SnapshotContent) UnmarshalJSON(b []byte) error

Special decoder for snapshot content

type SnapshotMessage

type SnapshotMessage struct {
	// Underlying message
	*Message
	// Context before the message
	PriorContext []*Message `json:"_prior_context,omitempty"`
	// Context after the message
	LeadingContext []*Message `json:"_leading_context,omitempty"`
}

Snapshot message data

type SnapshotWithContext

type SnapshotWithContext struct {
	// Users involved in snapshot
	Users []User `json:"_users"`
	// Channels involved in snapshot
	Channels []Channel `json:"_channels"`
	// Server involved in snapshot
	Server *Server `json:"_server,omitempty"`
	// Unique Id
	Id string `json:"_id"`
	// Report parent Id
	ReportId string `json:"report_id"`
	// Snapshot of content
	Content *SnapshotContent `json:"content"`
}

Snapshot of some content with required data to render

type Stats

type Stats struct {
	// Index usage information
	Indices map[string][]Index `json:"indices"`
	// Collection stats
	CollStats map[string]CollectionStats `json:"coll_stats"`
}

Server Stats

<these are technical admin stats>

type SystemMessageChannels

type SystemMessageChannels struct {
	// ID of channel to send user join messages in
	UserJoined string `json:"user_joined,omitempty"`
	// ID of channel to send user left messages in
	UserLeft string `json:"user_left,omitempty"`
	// ID of channel to send user kicked messages in
	UserKicked string `json:"user_kicked,omitempty"`
	// ID of channel to send user banned messages in
	UserBanned string `json:"user_banned,omitempty"`
}

System message channel assignments

type TwitchType

type TwitchType string

TwitchType : Type of remote Twitch content

<currently unused?>

const (
	CHANNEL_TwitchType TwitchType = "Channel"
	VIDEO_TwitchType   TwitchType = "Video"
	CLIP_TwitchType    TwitchType = "Clip"
)

List of TwitchType

type UnreadMessage

type UnreadMessage struct {
	// Composite primary key consisting of channel and user id
	Id *ChannelUnreadId `json:"_id"`
	// Id of the last message read in this channel by a user
	LastId string `json:"last_id,omitempty"`
	// Array of message ids that mention the user
	Mentions []string `json:"mentions,omitempty"`
}

type User

type User struct {
	// Unique Id
	Id string `json:"_id"`
	// Username
	Username string `json:"username"`
	// Discriminator
	Discriminator string `json:"discriminator"`
	// Display name
	DisplayName string `json:"display_name,omitempty"`
	// Avatar attachment
	Avatar *File `json:"avatar,omitempty"`
	// Relationships with other users
	Relations []Relationship `json:"relations,omitempty"`
	// Bitfield of user badges
	Badges uint64 `json:"badges,omitempty"`
	// User's current status
	Status *UserStatus `json:"status,omitempty"`
	// User's profile page
	Profile *UserProfile `json:"profile,omitempty"`
	// Enum of user flags
	Flags uint64 `json:"flags,omitempty"`
	// Whether this user is privileged
	Privileged bool `json:"privileged,omitempty"`
	// Bot information
	Bot *BotInformation `json:"bot,omitempty"`
	// Current session user's relationship with this user
	Relationship RelationshipStatus `json:"relationship,omitempty"`
	// Whether this user is currently online
	Online bool `json:"online,omitempty"`
}

Representiation of a User on Revolt.

type UserFlagResponse

type UserFlagResponse struct {
	// Flags
	Flags uint64 `json:"flags"`
}

type UserList

type UserList []*User

UserList : List of users

type UserPermission

type UserPermission string

UserPermission : User permission definitions

const (
	ACCESS_UserPermission       UserPermission = "Access"
	VIEW_PROFILE_UserPermission UserPermission = "ViewProfile"
	SEND_MESSAGE_UserPermission UserPermission = "SendMessage"
	INVITE_UserPermission       UserPermission = "Invite"
)

List of UserPermission

type UserProfile

type UserProfile struct {
	// Text content on user's profile
	Content string `json:"content,omitempty"`
	// Background visible on user's profile
	Background *File `json:"background,omitempty"`
}

User's profile

type UserProfileData

type UserProfileData struct {
	// Text to set as user profile description
	Content string `json:"content,omitempty"`
	// Attachment Id for background
	Background string `json:"background,omitempty"`
}

type UserReportReason

type UserReportReason string

UserReportReason : Reason for reporting a user

const (
	NONE_SPECIFIED_UserReportReason        UserReportReason = "NoneSpecified"
	UNSOLICITED_SPAM_UserReportReason      UserReportReason = "UnsolicitedSpam"
	SPAM_ABUSE_UserReportReason            UserReportReason = "SpamAbuse"
	INAPPROPRIATE_PROFILE_UserReportReason UserReportReason = "InappropriateProfile"
	IMPERSONATION_UserReportReason         UserReportReason = "Impersonation"
	BAN_EVASION_UserReportReason           UserReportReason = "BanEvasion"
	UNDERAGE_UserReportReason              UserReportReason = "Underage"
)

List of UserReportReason

type UserStatus

type UserStatus struct {
	// Custom status text
	Text string `json:"text,omitempty"`
	// Current presence option
	Presence Presence `json:"presence,omitempty"`
}

User's active status

type WebPushSubscription

type WebPushSubscription struct {
	Endpoint string `json:"endpoint"`
	P256dh   string `json:"p256dh"`
	Auth     string `json:"auth"`
}

Web Push subscription, all fields are mandatory/required

type Webhook

type Webhook struct {
	// Webhook Id
	Id string `json:"id"`
	// The name of the webhook
	Name string `json:"name"`
	// The avatar of the webhook
	Avatar *File `json:"avatar,omitempty"`
	// The channel this webhook belongs to
	ChannelId string `json:"channel_id"`
	// The private token for the webhook
	Token string `json:"token,omitempty"`
}

Webhook

type WebhookList

type WebhookList []*Webhook

WebhookList : List of webhooks

Directories

Path Synopsis
Note that while types.go is autogenerated, this file is NOT and is manually maintained
Note that while types.go is autogenerated, this file is NOT and is manually maintained
permissions
Defines permissions flags, taken from https://github.com/revoltchat/backend/blob/master/crates/quark/src/permissions/defn/permission.rs
Defines permissions flags, taken from https://github.com/revoltchat/backend/blob/master/crates/quark/src/permissions/defn/permission.rs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL