Documentation
¶
Index ¶
- Constants
- Variables
- func P[T any](t T) *T
- type API
- func (api *API) AcceptFriendRequest(user ULID) (u *User, err error)
- func (api *API) AcknowledgeMessage(channel, message ULID) error
- func (api *API) AddMemberToGroup(channel, member ULID) error
- func (api *API) AddReactionToMessage(channel, message ULID, emoji Emoji) error
- func (api *API) BanUser(server, user ULID, reason string) (b *Ban, err error)
- func (api *API) BlockUser(user ULID) (u *User, err error)
- func (api *API) BulkDeleteMessages(channel ULID, ids []ULID) error
- func (api *API) ChangeEmail(email, currentPassword string) error
- func (api *API) ChangePassword(password, currentPassword string) error
- func (api *API) ChangeUsername(params *ChangeUsername) (u *User, err error)
- func (api *API) CheckOnboardingStatus() (onboarding bool, err error)
- func (api *API) CloseChannel(channel ULID, leaveSilently *bool) error
- func (api *API) CompleteOnboarding(username string) error
- func (api *API) ConfirmAccountDeletion(token string) error
- func (api *API) CreateAccount(params *CreateAccount) error
- func (api *API) CreateBot(name string) (b *Bot, err error)
- func (api *API) CreateChannel(server ULID, params *CreateChannel) (c *Channel, err error)
- func (api *API) CreateEmoji(emoji string, params *CreateEmoji) (ce *CustomEmoji, err error)
- func (api *API) CreateGroup(params *CreateGroup) (c *Channel, err error)
- func (api *API) CreateInvite(channel ULID) (i *Invite, err error)
- func (api *API) CreateMFATicket(params *MFAResponse) (t *MFATicket, err error)
- func (api *API) CreateRole(server ULID, params *CreateRole) (rr *RoleResponse, err error)
- func (api *API) CreateServer(params *CreateServer) (sr *ServerResponse, err error)
- func (api *API) CreateStrike(user ULID, reason string) (s *Strike, err error)
- func (api *API) CreateWebhook(channel ULID, name string, avatar string) (w *Webhook, err error)
- func (api *API) DeleteAccount() error
- func (api *API) DeleteAllSessions(revokeSelf bool) error
- func (api *API) DeleteBot(bot ULID) error
- func (api *API) DeleteEmoji(emoji ULID) error
- func (api *API) DeleteInvite(invite string) error
- func (api *API) DeleteMessage(channel, message ULID) error
- func (api *API) DeleteRole(server, role ULID) error
- func (api *API) DeleteServer(server ULID) (err error)
- func (api *API) DeleteStrike(strike ULID) error
- func (api *API) DeleteWebhook(webhookID ULID, webhookToken string) error
- func (api *API) DenyFriendRequest(user ULID) (u *User, err error)
- func (api *API) DisableAccount() error
- func (api *API) DisableTOTP2FA() error
- func (api *API) EditBot(bot ULID, params EditBot) (b *Bot, err error)
- func (api *API) EditChannel(channel ULID, params *EditChannel) (c *Channel, err error)
- func (api *API) EditMember(server, member ULID, params *EditMember) (m *Member, err error)
- func (api *API) EditMessage(channel, message ULID, params *EditMessage) (m *Message, err error)
- func (api *API) EditReport(report ULID, params *EditReport) (r *Report, err error)
- func (api *API) EditRole(server, role ULID, params *EditRole) (r *Role, err error)
- func (api *API) EditServer(server ULID, params *EditServer) (s *Server, err error)
- func (api *API) EditSession(session, friendlyName string) (s *Session, err error)
- func (api *API) EditStrike(strike ULID, params *EditStrike) error
- func (api *API) EditUser(user ULID, params EditUser) (u *User, err error)
- func (api *API) EditWebhook(webhookID ULID, webhookToken string, params *EditWebhook) (w *Webhook, err error)
- func (api *API) EnableTOTP2FA(params *MFAResponse) error
- func (api *API) ExecuteWebhook(webhook ULID, token string, params *SendMessage) (m *Message, err error)
- func (api *API) FetchAccount() (a *Account, err error)
- func (api *API) FetchBans(server ULID) (br *BansResponse, err error)
- func (api *API) FetchBot(bot ULID) (b *Bot, u *User, err error)
- func (api *API) FetchChannel(channel ULID) (c *Channel, err error)
- func (api *API) FetchChannelWebhooks(channel ULID) (a []*Webhook, err error)
- func (api *API) FetchDefaultAvatar(user ULID) ([]byte, error)
- func (api *API) FetchDirectMessageChannels() (a []*Channel, err error)
- func (api *API) FetchEmoji(emoji ULID) (ce *CustomEmoji, err error)
- func (api *API) FetchGroupMembers(channel ULID) (a []*User, err error)
- func (api *API) FetchInvite(invite string) (i *InviteResponse, err error)
- func (api *API) FetchInvites(server ULID) (i []*Invite, err error)
- func (api *API) FetchMFAStatus() (s *MFAStatus, err error)
- func (api *API) FetchMember(server, member ULID) (m *Member, err error)
- func (api *API) FetchMembers(server ULID, params *FetchMembers) (fmr *FetchMembersResponse, err error)
- func (api *API) FetchMessage(channel, message ULID) (m *Message, err error)
- func (api *API) FetchMessages(channel ULID, params *FetchMessages) (m *Messages, err error)
- func (api *API) FetchMutualFriendsAndServers(user ULID) (users []ULID, servers []ULID, err error)
- func (api *API) FetchOwnedBots() (b []*Bot, u []*User, err error)
- func (api *API) FetchPublicBot(bot ULID) (b *PublicBot, err error)
- func (api *API) FetchRecoveryCodes() (a []string, err error)
- func (api *API) FetchReport(report ULID) (r *Report, err error)
- func (api *API) FetchReports(params *FetchReports) (a []*Report, err error)
- func (api *API) FetchSelf() (u *User, err error)
- func (api *API) FetchServer(server ULID) (s *Server, err error)
- func (api *API) FetchServerEmojis(server ULID) (a []*CustomEmoji, err error)
- func (api *API) FetchSessions() (s []*Session, err error)
- func (api *API) FetchSettings(keys []string) (m map[string]*Setting, err error)
- func (api *API) FetchSnapshots(report ULID) (a []*Snapshot, err error)
- func (api *API) FetchStrikes(user ULID) (a []*Strike, err error)
- func (api *API) FetchUnreads() (a []*UnreadMessage, err error)
- func (api *API) FetchUser(user ULID) (u *User, err error)
- func (api *API) FetchUserFlags(user ULID) (UserFlags, error)
- func (api *API) FetchUserProfile(user ULID) (p *UserProfile, err error)
- func (api *API) FetchWebhook(webhookID ULID, webhookToken string) (w *Webhook, err error)
- func (api *API) GenerateRecoveryCodes() (a []string, err error)
- func (api *API) GenerateTOTPSecret() (s string, err error)
- func (api *API) GetMFAMethods() (a []MFAMethod, err error)
- func (api *API) GloballyFetchMessages(params *GloballyFetchMessages) (m *Messages, err error)
- func (api *API) InviteBot(bot ULID, params *InviteBot) error
- func (api *API) JoinCall(channel ULID) (string, error)
- func (api *API) JoinInvite(invite string) (jir *JoinInviteResponse, err error)
- func (api *API) KickMember(server, member ULID) error
- func (api *API) LeaveServer(server ULID, params *LeaveServer) (err error)
- func (api *API) Login(params *Login) (lr *LoginResponse, err error)
- func (api *API) Logout() error
- func (api *API) MarkServerAsRead(server ULID) (err error)
- func (api *API) OpenDirectMessage(user ULID) (c *Channel, err error)
- func (api *API) PasswordReset(token, password string, removeSessions bool) error
- func (api *API) PushSubscribe(params WebPushSubscription) error
- func (api *API) QueryMembersByName(server ULID, query string) (ma []*Member, mu []*User, err error)
- func (api *API) QueryNode() (n *Node, err error)
- func (api *API) QueryStats() (st *InstanceStatistics, err error)
- func (api *API) RemoveAllReactionsFromMessage(channel, message ULID) error
- func (api *API) RemoveFriend(user ULID) (u *User, err error)
- func (api *API) RemoveMemberFromGroup(channel, member ULID) error
- func (api *API) RemoveReactionsFromMessage(channel, message ULID, emoji Emoji) error
- func (api *API) ReportContent(content *ReportContent, additionalContext string) error
- func (api *API) Request(route Route, options *RequestOptions) (*http.Response, error)
- func (api *API) RequestJSON(v any, route Route, options *RequestOptions) error
- func (api *API) RequestNone(route Route, options *RequestOptions) error
- func (api *API) ResendVerification(email, captcha string) error
- func (api *API) RevokeSession(session string) error
- func (api *API) SearchForMessages(channel ULID, params *SearchForMessages) (m *Messages, err error)
- func (api *API) SendFriendRequest(username string) (u *User, err error)
- func (api *API) SendMessage(channel ULID, params *SendMessage) (m *Message, err error)
- func (api *API) SendPasswordReset(email, captcha string) error
- func (api *API) SetDefaultChannelPermission(channel ULID, params *SetDefaultPermission) (c *Channel, err error)
- func (api *API) SetDefaultServerPermission(server ULID, params *SetDefaultPermission) (s *Server, err error)
- func (api *API) SetRoleChannelPermission(channel, role ULID, allow, deny Permissions) (c *Channel, err error)
- func (api *API) SetRoleServerPermission(server, role ULID, allow, deny Permissions) (s *Server, err error)
- func (api *API) SetSettings(timestamp int64, data map[string]string) error
- func (api *API) UnbanUser(server, user ULID) error
- func (api *API) UnblockUser(user ULID) (u *User, err error)
- func (api *API) Unsubscribe() error
- func (api *API) VerifyEmail(code string) (ticket *MFATicket, err error)
- type APIConfig
- type APIError
- type Account
- type ArshalNotImplemented
- type Auth
- type AuthEventType
- type Authenticated
- type AutumnAPI
- func (api *AutumnAPI) FetchConfig() (c *AutumnConfig, err error)
- func (api *AutumnAPI) Get(tag, id string) ([]byte, error)
- func (api *AutumnAPI) Request(route Route, options *RequestOptions) (*http.Response, error)
- func (api *AutumnAPI) RequestJSON(v any, route Route, options *RequestOptions) error
- func (api *AutumnAPI) Upload(tag UploadTag, filename, contentType string, contents []byte) (s string, err error)
- type AutumnAPIConfig
- type AutumnConfig
- type AutumnFile
- type AutumnFileMetadata
- type AutumnFileMetadataType
- type AutumnTag
- type Ban
- type BansResponse
- type Bot
- type BotFlags
- type BuildInformation
- type BulkDeleteMessage
- type Cache1
- type Cache1CheckContext
- type Cache1Checker
- type Cache2
- func (c *Cache2[T]) Del(parent, id ULID)
- func (c *Cache2[T]) DelGroup(parent ULID)
- func (c *Cache2[T]) Get(parent, id ULID) *T
- func (c *Cache2[T]) GroupsCount() int
- func (c *Cache2[T]) PartiallyUpdate(parent, id ULID, updater func(m *T))
- func (c *Cache2[T]) Set(parent ULID, v *T)
- func (c *Cache2[T]) Size() int
- type Cache2CheckContext
- type Cache2Checker
- type Cacheable
- type Category
- type ChangeUsername
- type Channel
- type ChannelAck
- type ChannelDelete
- type ChannelGroupJoin
- type ChannelGroupLeave
- type ChannelStartTyping
- type ChannelStopTyping
- type ChannelType
- type ChannelUpdate
- type CollectionScans
- type CollectionStats
- type CreateAccount
- type CreateChannel
- type CreateEmoji
- type CreateGroup
- type CreateRole
- type CreateServer
- type CustomEmoji
- type CustomEmojiParent
- type CustomEmojiParentType
- type DefaultHTTPClient
- type DefaultWebsocketDialer
- type DeletionInfo
- type DeletionInfoStatus
- type EditBot
- type EditChannel
- type EditMember
- type EditMessage
- func (em *EditMessage) AddEmbeds(embeds ...SendableEmbed) *EditMessage
- func (em *EditMessage) SetContent(content string) *EditMessage
- func (em *EditMessage) SetEmbeds(embeds *[]SendableEmbed) *EditMessage
- func (em *EditMessage) UnsetContent() *EditMessage
- func (em *EditMessage) UnsetEmbeds() *EditMessage
- type EditProfile
- type EditReport
- type EditReportStatus
- type EditRole
- type EditServer
- func (es *EditServer) AddCategories(categories ...Category) *EditServer
- func (es *EditServer) RemoveBanner() *EditServer
- func (es *EditServer) RemoveCategories() *EditServer
- func (es *EditServer) RemoveDescription() *EditServer
- func (es *EditServer) RemoveIcon() *EditServer
- func (es *EditServer) RemoveSystemMessages() *EditServer
- func (es *EditServer) SetCategories(categories *[]Category) *EditServer
- func (es *EditServer) SetDescription(description string) *EditServer
- func (es *EditServer) SetFlags(flags ServerFlags) *EditServer
- func (es *EditServer) SetIcon(icon string) *EditServer
- func (es *EditServer) SetName(name string) *EditServer
- func (es *EditServer) SetSystemMessages(systemMessages EditSystemMessages) *EditServer
- func (es *EditServer) UnsetCategories() *EditServer
- func (es *EditServer) UnsetDescription() *EditServer
- func (es *EditServer) UnsetIcon() *EditServer
- func (es *EditServer) UnsetName() *EditServer
- func (es *EditServer) UnsetSystemMessages() *EditServer
- type EditStrike
- type EditSystemMessages
- type EditUser
- func (eu EditUser) MarshalJSON() ([]byte, error)
- func (eu *EditUser) RemoveAvatar() *EditUser
- func (eu *EditUser) RemoveDisplayName() *EditUser
- func (eu *EditUser) RemoveProfileBackground() *EditUser
- func (eu *EditUser) RemoveProfileContent() *EditUser
- func (eu *EditUser) RemoveStatusPresence() *EditUser
- func (eu *EditUser) RemoveStatusText() *EditUser
- type EditWebhook
- type EmailVerification
- type EmailVerificationStatus
- type Embed
- type EmbedImage
- type EmbedImageSize
- type EmbedSpecial
- type EmbedSpecialType
- type EmbedType
- type EmbedVideo
- type Emoji
- type EmojiDelete
- type EventController
- func (ec *EventController[T]) Emit(t T) *EventController[T]
- func (ec *EventController[T]) EmitAndCall(t T, f func(T)) *EventController[T]
- func (ec *EventController[T]) EmitInGoroutines(t T) *EventController[T]
- func (ec *EventController[T]) Listen(f func(T)) *Subscription[T]
- func (ec *EventController[T]) Override(f func(T)) *Subscription[T]
- type Events
- type FeatureConfiguration
- type FetchMembers
- type FetchMembersResponse
- type FetchMessages
- type FetchReports
- type GenericCache
- type GenericServiceConfiguration
- type GloballyFetchMessages
- type HCaptchaConfiguration
- type HTTPClient
- type Index
- type IndexAccesses
- type InstanceStatistics
- type Invite
- type InviteBot
- type InviteResponse
- type InviteType
- type JSONArshaler
- type JoinInviteResponse
- type LatencyHistogramEntry
- type LatencyStats
- type LeaveServer
- type Lockout
- type Login
- type LoginResponse
- type LoginResponseType
- type MFAMethod
- type MFAResponse
- type MFAStatus
- type MFATicket
- type Marshal
- type Masquerade
- type Member
- type MemberID
- type Message
- type MessageAppend
- type MessageDelete
- type MessageInteractions
- type MessageReact
- type MessageRemoveReaction
- type MessageSort
- type MessageUnreact
- type MessageUpdate
- type MessageWebhook
- type Messages
- type MultiFactorAuthentication
- type Node
- type OptimizedAutumnFile
- type OptimizedAutumnFileFlags
- type OptimizedAutumnFileMetadata
- type OptimizedAutumnFileMetadataType
- type OptimizedChannel
- type OptimizedChannelFlags
- type OptimizedChannelType
- type OptimizedCustomEmoji
- type OptimizedCustomEmojiFlags
- type OptimizedCustomEmojiParent
- type OptimizedCustomEmojiParentType
- type OptimizedEmbed
- type OptimizedEmbedImage
- type OptimizedEmbedImageSize
- type OptimizedEmbedSpecial
- type OptimizedEmbedSpecialType
- type OptimizedEmbedType
- type OptimizedMessage
- type OptimizedPresence
- type OptimizedRelationshipStatus
- type OptimizedRole
- type OptimizedRoleFlags
- type OptimizedServer
- type OptimizedServerFlags
- type OptimizedSystemEventMessage
- type OptimizedSystemEventMessageType
- type OptimizedUser
- type OptimizedUserFlags
- type OptimizedUserProfile
- type OptimizedUserStatus
- type OptimizedWebhook
- type PartialChannel
- type PartialMember
- type PartialMessage
- type PartialRole
- type PartialServer
- type PartialUser
- type PartialWebhook
- type PasswordReset
- type PermissionOverride
- type Permissions
- type Presence
- type PublicBot
- type QueryExecStats
- type Ready
- type RelationshipStatus
- type Reply
- type Report
- type ReportContent
- type ReportContentType
- type ReportReason
- type ReportStatus
- type RequestOptions
- type Role
- type RoleResponse
- type Route
- type SearchForMessages
- type SendMessage
- func (sm *SendMessage) AddAttachments(attachments ...string) *SendMessage
- func (sm *SendMessage) AddEmbeds(embeds ...SendableEmbed) *SendMessage
- func (sm *SendMessage) AddReply(replies ...Reply) *SendMessage
- func (sm *SendMessage) ReplyTo(messages ...ULID) *SendMessage
- func (sm *SendMessage) SetAttachments(attachments []string) *SendMessage
- func (sm *SendMessage) SetContent(content string) *SendMessage
- func (sm *SendMessage) SetEmbeds(embeds []SendableEmbed) *SendMessage
- func (sm *SendMessage) SetInteractions(interactions *MessageInteractions) *SendMessage
- func (sm *SendMessage) SetMasquerade(masquerade *Masquerade) *SendMessage
- func (sm *SendMessage) SetReplies(replies []Reply) *SendMessage
- type SendableEmbed
- type Server
- type ServerCreate
- type ServerDelete
- type ServerFlags
- type ServerMemberJoin
- type ServerMemberLeave
- type ServerMemberUpdate
- type ServerResponse
- type ServerRoleDelete
- type ServerRoleUpdate
- type ServerUpdate
- type Session
- type SetDefaultPermission
- type Setting
- type Snapshot
- type SnapshotContent
- type SnapshotContentType
- type Socket
- func (socket *Socket) Authenticate() error
- func (socket *Socket) BeginTyping(channel ULID) error
- func (socket *Socket) Close() error
- func (socket *Socket) CloseWithCode(closeCode int) error
- func (socket *Socket) Connect() error
- func (socket *Socket) EndTyping(channel ULID) error
- func (socket *Socket) Latency() time.Duration
- func (socket *Socket) LatencyMs() float64
- func (socket *Socket) Listen()
- func (socket *Socket) OnAuth(f func(*Auth)) *Subscription[*Auth]
- func (socket *Socket) OnAuthenticated(f func(*Authenticated)) *Subscription[*Authenticated]
- func (socket *Socket) OnBulkDeleteMessage(f func(*BulkDeleteMessage)) *Subscription[*BulkDeleteMessage]
- func (socket *Socket) OnChannelAck(f func(*ChannelAck)) *Subscription[*ChannelAck]
- func (socket *Socket) OnChannelCreate(f func(*Channel)) *Subscription[*Channel]
- func (socket *Socket) OnChannelDelete(f func(*ChannelDelete)) *Subscription[*ChannelDelete]
- func (socket *Socket) OnChannelGroupJoin(f func(*ChannelGroupJoin)) *Subscription[*ChannelGroupJoin]
- func (socket *Socket) OnChannelGroupLeave(f func(*ChannelGroupLeave)) *Subscription[*ChannelGroupLeave]
- func (socket *Socket) OnChannelStartTyping(f func(*ChannelStartTyping)) *Subscription[*ChannelStartTyping]
- func (socket *Socket) OnChannelStopTyping(f func(*ChannelStopTyping)) *Subscription[*ChannelStopTyping]
- func (socket *Socket) OnChannelUpdate(f func(*ChannelUpdate)) *Subscription[*ChannelUpdate]
- func (socket *Socket) OnEmojiCreate(f func(*CustomEmoji)) *Subscription[*CustomEmoji]
- func (socket *Socket) OnEmojiDelete(f func(*EmojiDelete)) *Subscription[*EmojiDelete]
- func (socket *Socket) OnError(f func(error)) *Subscription[error]
- func (socket *Socket) OnMessage(f func(*Message)) *Subscription[*Message]
- func (socket *Socket) OnMessageAppend(f func(*MessageAppend)) *Subscription[*MessageAppend]
- func (socket *Socket) OnMessageDelete(f func(*MessageDelete)) *Subscription[*MessageDelete]
- func (socket *Socket) OnMessageReact(f func(*MessageReact)) *Subscription[*MessageReact]
- func (socket *Socket) OnMessageRemoveReaction(f func(*MessageRemoveReaction)) *Subscription[*MessageRemoveReaction]
- func (socket *Socket) OnMessageUnreact(f func(*MessageUnreact)) *Subscription[*MessageUnreact]
- func (socket *Socket) OnMessageUpdate(f func(*MessageUpdate)) *Subscription[*MessageUpdate]
- func (socket *Socket) OnRaw(f func(map[string]any)) *Subscription[map[string]any]
- func (socket *Socket) OnReady(f func(*Ready)) *Subscription[*Ready]
- func (socket *Socket) OnReportCreate(f func(*Report)) *Subscription[*Report]
- func (socket *Socket) OnRevoltError(f func(string)) *Subscription[string]
- func (socket *Socket) OnServerCreate(f func(*ServerCreate)) *Subscription[*ServerCreate]
- func (socket *Socket) OnServerDelete(f func(*ServerDelete)) *Subscription[*ServerDelete]
- func (socket *Socket) OnServerMemberJoin(f func(*ServerMemberJoin)) *Subscription[*ServerMemberJoin]
- func (socket *Socket) OnServerMemberLeave(f func(*ServerMemberLeave)) *Subscription[*ServerMemberLeave]
- func (socket *Socket) OnServerMemberUpdate(f func(*ServerMemberUpdate)) *Subscription[*ServerMemberUpdate]
- func (socket *Socket) OnServerRoleDelete(f func(*ServerRoleDelete)) *Subscription[*ServerRoleDelete]
- func (socket *Socket) OnServerRoleUpdate(f func(*ServerRoleUpdate)) *Subscription[*ServerRoleUpdate]
- func (socket *Socket) OnServerUpdate(f func(*ServerUpdate)) *Subscription[*ServerUpdate]
- func (socket *Socket) OnUserPlatformWipe(f func(*UserPlatformWipe)) *Subscription[*UserPlatformWipe]
- func (socket *Socket) OnUserRelationship(f func(*UserRelationship)) *Subscription[*UserRelationship]
- func (socket *Socket) OnUserSettingsUpdate(f func(*UserSettingsUpdate)) *Subscription[*UserSettingsUpdate]
- func (socket *Socket) OnUserUpdate(f func(*UserUpdate)) *Subscription[*UserUpdate]
- func (socket *Socket) OnWebhookCreate(f func(*Webhook)) *Subscription[*Webhook]
- func (socket *Socket) OnWebhookDelete(f func(*WebhookDelete)) *Subscription[*WebhookDelete]
- func (socket *Socket) OnWebhookUpdate(f func(*WebhookUpdate)) *Subscription[*WebhookUpdate]
- func (socket *Socket) Open() (err error)
- func (socket *Socket) Ping() error
- func (socket *Socket) Write(typ string, d map[string]any) error
- type SocketAccount
- type SocketConfig
- type SocketError
- type SocketSession
- type Strike
- type Subscription
- type SystemEventMessage
- type SystemEventMessageType
- type SystemMessages
- type TOTP
- type TOTPStatus
- type Time
- type Token
- type TokenType
- type ULID
- type Unmarshal
- type UnreadMessage
- type UnreadMessageID
- type UploadTag
- type User
- type UserBadges
- type UserBot
- type UserFlags
- type UserPlatformWipe
- type UserProfile
- type UserRelation
- type UserRelationship
- type UserSettingsUpdate
- type UserStatus
- type UserUpdate
- func (uu *UserUpdate) IsAvatarRemoved() bool
- func (uu *UserUpdate) IsDisplayNameRemoved() bool
- func (uu *UserUpdate) IsProfileBackgroundRemoved() bool
- func (uu *UserUpdate) IsProfileContentRemoved() bool
- func (uu *UserUpdate) IsStatusPresenceRemoved() bool
- func (uu *UserUpdate) IsStatusTextRemoved() bool
- type VoiceServerConfiguration
- type WebPushSubscription
- type Webhook
- type WebhookDelete
- type WebhookUpdate
- type WebsocketDialer
Constants ¶
const InfiniteCache int = -1
const Version = "1.1.0"
! |-- Revolt API version ! | ! | |-- Regolt major version ! | | ! | | |-- Regolt minor version
Variables ¶
var ( // API.QueryNode() -> GET / RouteQueryNode = func() Route { return Route{"GET", "/"} } // API.FetchSelf() -> GET /users/@me RouteFetchSelf = func() Route { return Route{"GET", "/users/@me"} } // API.FetchUser(user) -> GET /users/{user} RouteFetchUser = func(user ULID) Route { return Route{"GET", "/users/" + user.EncodeFP()} } // API.EditUser(user, params) -> PATCH /users/{user} RouteEditUser = func(user ULID) Route { return Route{"PATCH", "/users/" + user.EncodeFP()} } // API.FetchUserFlags(user) -> GET /users/{user}/flags RouteFetchUserFlags = func(user ULID) Route { return Route{"GET", "/users/" + user.EncodeFP() + "/flags"} } // API.ChangeUsername(params) -> PATCH /users/@me/username RouteChangeUsername = func() Route { return Route{"PATCH", "/users/@me/username"} } // API.FetchDefaultAvatar(user) -> GET /users/{user}/default_avatar RouteFetchDefaultAvatar = func(user ULID) Route { return Route{"GET", "/users/" + user.EncodeFP() + "/default_avatar"} } // API.FetchUserProfile(user) -> GET /users/{user}/profile RouteFetchUserProfile = func(user ULID) Route { return Route{"GET", "/users/" + user.EncodeFP() + "/profile"} } // API.FetchDirectMessageChannels() -> GET /users/dms RouteFetchDirectMessageChannels = func() Route { return Route{"GET", "/users/dms"} } // API.OpenDirectMessage(user) -> GET /users/{user}/dm RouteOpenDirectMessage = func(user ULID) Route { return Route{"GET", "/users/" + user.EncodeFP() + "/dm"} } // API.FetchMutualFriendsAndServers(user) -> GET /users/{user}/mutual RouteFetchMutualFriendsAndServers = func(user ULID) Route { return Route{"GET", "/users/" + user.EncodeFP() + "/mutual"} } // API.AcceptFriendRequest(user) -> PUT /users/{user}/friend RouteAcceptFriendRequest = func(user ULID) Route { return Route{"PUT", "/users/" + user.EncodeFP() + "/friend"} } // API.DenyFriendRequest(user) -> DELETE /users/{user}/friend RouteDenyFriendRequest = func(user ULID) Route { return Route{"DELETE", "/users/" + user.EncodeFP() + "/friend"} } // API.RemoveFriend(user) -> DELETE /users/{user}/friend RouteRemoveFriend = func(user ULID) Route { return Route{"DELETE", "/users/" + user.EncodeFP() + "/friend"} } // API.BlockUser(user) -> PUT /users/{user}/block RouteBlockUser = func(user ULID) Route { return Route{"PUT", "/users/" + user.EncodeFP() + "/block"} } // API.UnblockUser(user) -> DELETE /users/{user}/block RouteUnblockUser = func(user ULID) Route { return Route{"DELETE", "/users/" + user.EncodeFP() + "/block"} } // API.SendFriendRequest(username) -> POST /users/friend RouteSendFriendRequest = func() Route { return Route{"POST", "/users/friend"} } // API.CreateBot(name) -> POST /bots/create RouteCreateBot = func() Route { return Route{"POST", "/bots/create"} } // API.FetchPublicBot(bot) -> GET /bots/{bot}/invite RouteFetchPublicBot = func(bot ULID) Route { return Route{"GET", "/bots/" + bot.EncodeFP() + "/invite"} } // API.InviteBot(bot, params) -> POST /bots/{bot}/invite RouteInviteBot = func(bot ULID) Route { return Route{"POST", "/bots/" + bot.EncodeFP() + "/invite"} } // API.FetchBot(bot) -> GET /bots/{bot} RouteFetchBot = func(bot ULID) Route { return Route{"GET", "/bots/" + bot.EncodeFP()} } // API.FetchOwnedBots() -> GET /bots/@me RouteFetchOwnedBots = func() Route { return Route{"GET", "/bots/@me"} } // API.DeleteBot(bot) -> DELETE /bots/{bot} RouteDeleteBot = func(bot ULID) Route { return Route{"DELETE", "/bots/" + bot.EncodeFP()} } // API.EditBot(bot, params) -> PATCH /bots/{bot} RouteEditBot = func(bot ULID) Route { return Route{"PATCH", "/bots/" + bot.EncodeFP()} } // API.FetchChannel(channel) -> GET /channels/{channel} RouteFetchChannel = func(channel ULID) Route { return Route{"GET", "/channels/" + channel.EncodeFP()} } // API.CloseChannel(channel) -> DELETE /channels/{channel} RouteCloseChannel = func(channel ULID) Route { return Route{"DELETE", "/channels/" + channel.EncodeFP()} } // API.EditChannel(channel, params) -> PATCH /channels/{channel} RouteEditChannel = func(channel ULID) Route { return Route{"PATCH", "/channels/" + channel.EncodeFP()} } // API.CreateInvite(channel) -> POST /channels/{channel}/invites RouteCreateInvite = func(channel ULID) Route { return Route{"POST", "/channels/" + channel.EncodeFP() + "/invites"} } // API.SetRoleChannelPermission(channel, role, allow, deny) -> PUT /channels/{channel}/permissions/{role} RouteSetRoleChannelPermission = func(channel, role ULID) Route { return Route{"PUT", "/channels/" + channel.EncodeFP() + "/permissions/" + role.EncodeFP()} } // API.SetDefaultChannelPermission(channel, allow, deny) -> PUT /channels/{channel}/permissions/default RouteSetDefaultChannelPermission = func(channel ULID) Route { return Route{"PUT", "/channels/" + channel.EncodeFP() + "/permissions/default"} } // API.AcknowledgeMessage(channel, message) -> PUT /channels/{channel}/ack/{message} RouteAcknowledgeMessage = func(channel, message ULID) Route { return Route{"PUT", "/channels/" + channel.EncodeFP() + "/ack/" + message.EncodeFP()} } // API.FetchMessages(channel, params) -> GET /channels/{channel}/messages RouteFetchMessages = func(channel ULID) Route { return Route{"GET", "/channels/" + channel.EncodeFP() + "/messages"} } // API.SendMessage(channel, params) -> POST /channels/{channel}/messages RouteSendMessage = func(channel ULID) Route { return Route{"POST", "/channels/" + channel.EncodeFP() + "/messages"} } // API.SearchForMessages(channel) -> POST /channels/{channel}/search RouteSearchForMessages = func(channel ULID) Route { return Route{"POST", "/channels/" + channel.EncodeFP() + "/search"} } // API.FetchMessage(channel, message) -> GET /channels/{channel}/messages/{message} RouteFetchMessage = func(channel, message ULID) Route { return Route{"GET", "/channels/" + channel.EncodeFP() + "/messages/" + message.EncodeFP()} } // API.DeleteMessage(channel, message) -> DELETE /channels/{channel}/messages/{message} RouteDeleteMessage = func(channel, message ULID) Route { return Route{"DELETE", "/channels/" + channel.EncodeFP() + "/messages/" + message.EncodeFP()} } // API.EditMessage(channel, message, params) -> PATCH /channels/{channel}/messages/{message} RouteEditMessage = func(channel, message ULID) Route { return Route{"PATCH", "/channels/" + channel.EncodeFP() + "/messages/" + message.EncodeFP()} } // API.BulkDeleteMessages(channel, ids) -> DELETE /channels/{channel}/messages/bulk RouteBulkDeleteMessages = func(channel ULID) Route { return Route{"DELETE", "/channels/" + channel.EncodeFP() + "/messages/bulk"} } // API.AddReactionToMessage(channel, message, emoji) -> PUT /channels/{channel}/messages/{message}/reactions/{emoji} RouteAddReactionToMessage = func(channel, message ULID, emoji Emoji) Route { return Route{"PUT", "/channels/" + channel.EncodeFP() + "/messages/" + message.EncodeFP() + "/reactions/" + emoji.EncodeFP()} } // API.RemoveReactionsFromMessage(channel, message, emoji) -> DELETE /channels/{channel}/messages/{message}/reactions/{emoji} RouteRemoveReactionsFromMessage = func(channel, message ULID, emoji Emoji) Route { return Route{"DELETE", "/channels/" + channel.EncodeFP() + "/messages/" + message.EncodeFP() + "/reactions/" + emoji.EncodeFP()} } // API.RemoveAllReactionsFromMessage(channel, message) -> DELETE /channels/{channel}/messages/{message}/reactions RouteRemoveAllReactionsFromMessage = func(channel, message ULID) Route { return Route{"DELETE", "/channels/" + channel.EncodeFP() + "/messages/" + message.EncodeFP() + "/reactions"} } // API.FetchGroupMembers(channel) -> GET /channels/{channel}/members RouteFetchGroupMembers = func(channel ULID) Route { return Route{"GET", "/channels/" + channel.EncodeFP() + "/members"} } // API.CreateGroup(params) -> POST /channels/create RouteCreateGroup = func() Route { return Route{"POST", "/channels/create"} } // API.AddMemberToGroup(channel, member) -> PUT /channels/{channel}/recipients/{member} RouteAddMemberToGroup = func(channel, member ULID) Route { return Route{"PUT", "/channels/" + channel.EncodeFP() + "/recipients/" + member.EncodeFP()} } // API.RemoveMemberFromGroup(channel, member) -> DELETE /channels/{channel}/recipients/{member} RouteRemoveMemberFromGroup = func(channel, member ULID) Route { return Route{"DELETE", "/channels/" + channel.EncodeFP() + "/recipients/" + member.EncodeFP()} } // API.JoinCall(channel) -> POST /channels/{channel}/join_call RouteJoinCall = func(channel ULID) Route { return Route{"POST", "/channels/" + channel.EncodeFP() + "/join_call"} } // API.CreateWebhook(channel, name, avatar) -> POST /channels/{channel}/webhooks RouteCreateWebhook = func(channel ULID) Route { return Route{"POST", "/channels/" + channel.EncodeFP() + "/webhooks"} } // API.DeleteWebhook(webhook, "") -> DELETE /webhooks/{webhook} RouteDeleteWebhook = func(webhook ULID) Route { return Route{"DELETE", "/webhooks/" + webhook.EncodeFP()} } // API.DeleteWebhook(webhook, token) -> DELETE /webhooks/{webhook}/{token} RouteDeleteWebhookWithToken = func(webhook ULID, token string) Route { return Route{"DELETE", "/webhooks/" + webhook.EncodeFP() + "/" + url.PathEscape(token)} } // API.EditWebhook(webhook, "", params) -> PATCH /webhooks/{webhook} RouteEditWebhook = func(webhook ULID) Route { return Route{"PATCH", "/webhooks/" + webhook.EncodeFP()} } // API.EditWebhook(webhook, token, params) -> PATCH /webhooks/{webhook}/{token} RouteEditWebhookWithToken = func(webhook ULID, token string) Route { return Route{"PATCH", "/webhooks/" + webhook.EncodeFP() + "/" + url.PathEscape(token)} } // API.ExecuteWebhook(webhook, token, params) -> POST /webhooks/{webhook}/{token} RouteExecuteWebhook = func(webhook ULID, token string) Route { return Route{"POST", "/webhooks/" + webhook.EncodeFP() + "/" + url.PathEscape(token)} } // API.FetchWebhook(webhook, "") -> GET /webhooks/{webhook} RouteFetchWebhook = func(webhook ULID) Route { return Route{"GET", "/webhooks/" + webhook.EncodeFP()} } // API.FetchWebhook(webhook, token) -> GET /webhooks/{webhook}/{token} RouteFetchWebhookWithToken = func(webhook ULID, token string) Route { return Route{"GET", "/webhooks/" + webhook.EncodeFP() + "/" + url.PathEscape(token)} } // API.FetchChannelWebhooks(channel) -> GET /channels/{channel}/webhooks RouteFetchChannelWebhooks = func(channel ULID) Route { return Route{"GET", "/channels/" + channel.EncodeFP() + "/webhooks"} } // API.CreateServer(params) -> POST /servers/create RouteCreateServer = func() Route { return Route{"POST", "/servers/create"} } // API.FetchServer(server) -> GET /servers/{server} RouteFetchServer = func(server ULID) Route { return Route{"GET", "/servers/" + server.EncodeFP()} } // API.DeleteServer(server) -> DELETE /servers/{server} RouteDeleteServer = func(server ULID) Route { return Route{"DELETE", "/servers/" + server.EncodeFP()} } // API.LeaveServer(server) -> DELETE /servers/{server} RouteLeaveServer = func(server ULID) Route { return Route{"DELETE", "/servers/" + server.EncodeFP()} } // API.EditServer(server, params) -> PATCH /servers/{server} RouteEditServer = func(server ULID) Route { return Route{"PATCH", "/servers/" + server.EncodeFP()} } // API.MarkServerAsRead(server) -> PUT /servers/{server}/ack RouteMarkServerAsRead = func(server ULID) Route { return Route{"PUT", "/servers/" + server.EncodeFP() + "/ack"} } // API.CreateChannel(server, params) -> POST /servers/{server}/channels RouteCreateChannel = func(server ULID) Route { return Route{"POST", "/servers/" + server.EncodeFP() + "/channels"} } // API.FetchMembers(server, params) -> GET /servers/{server}/members RouteFetchMembers = func(server ULID) Route { return Route{"GET", "/servers/" + server.EncodeFP() + "/members"} } // API.FetchMember(server, member) -> GET /servers/{server}/members/{member} RouteFetchMember = func(server ULID, member ULID) Route { return Route{"GET", "/servers/" + server.EncodeFP() + "/members/" + member.EncodeFP()} } // API.KickMember(server, member) -> DELETE /servers/{server}/members/{member} RouteKickMember = func(server ULID, member ULID) Route { return Route{"DELETE", "/servers/" + server.EncodeFP() + "/members/" + member.EncodeFP()} } // API.EditMember(server, member, params) -> PATCH /servers/{server}/members/{member} RouteEditMember = func(server ULID, member ULID) Route { return Route{"PATCH", "/servers/" + server.EncodeFP() + "/members/" + member.EncodeFP()} } // API.QueryMembersByName(server, query) -> GET /servers/{server}/members_experimental_query RouteQueryMembersByName = func(server ULID) Route { return Route{"GET", "/servers/" + server.EncodeFP() + "/members_experimental_query"} } // API.BanUser(server, user, reason) -> PUT /servers/{server}/bans/{user} RouteBanUser = func(server ULID, user ULID) Route { return Route{"PUT", "/servers/" + server.EncodeFP() + "/bans/" + user.EncodeFP()} } // API.UnbanUser(server, user) -> DELETE /servers/{server}/bans/{user} RouteUnbanUser = func(server ULID, user ULID) Route { return Route{"DELETE", "/servers/" + server.EncodeFP() + "/bans/" + user.EncodeFP()} } // API.FetchBans(server) -> GET /servers/{server}/bans RouteFetchBans = func(server ULID) Route { return Route{"GET", "/servers/" + server.EncodeFP() + "/bans"} } // API.FetchInvites(server) -> GET /servers/{server}/invites RouteFetchInvites = func(server ULID) Route { return Route{"GET", "/servers/" + server.EncodeFP() + "/invites"} } // API.CreateRole(server, params) -> POST /servers/{server}/roles RouteCreateRole = func(server ULID) Route { return Route{"POST", "/servers/" + server.EncodeFP() + "/roles"} } // API.DeleteRole(server, role) -> DELETE /servers/{server}/roles/{role} RouteDeleteRole = func(server ULID, role ULID) Route { return Route{"DELETE", "/servers/" + server.EncodeFP() + "/roles/" + role.EncodeFP()} } // API.EditRole(server, role) -> PATCH /servers/{server}/roles/{role} RouteEditRole = func(server ULID, role ULID) Route { return Route{"PATCH", "/servers/" + server.EncodeFP() + "/roles/" + role.EncodeFP()} } // API.SetRoleServerPermission(server, role, allow, deny) -> PUT /servers/{server}/permissions/{role} RouteSetRoleServerPermission = func(server ULID, role ULID) Route { return Route{"PUT", "/servers/" + server.EncodeFP() + "/permissions/" + role.EncodeFP()} } // API.SetDefaultServerPermission(server,, allow, deny) -> PUT /servers/{server}/permissions/default RouteSetDefaultServerPermission = func(server ULID) Route { return Route{"PUT", "/servers/" + server.EncodeFP() + "/permissions/default"} } // API.FetchInvite(invite) -> GET /invites/{invite} RouteFetchInvite = func(invite string) Route { return Route{"GET", "/invites/" + url.PathEscape(invite)} } // API.JoinInvite(invite) -> POST /invites/{invite} RouteJoinInvite = func(invite string) Route { return Route{"POST", "/invites/" + url.PathEscape(invite)} } // API.DeleteInvite(invite) -> DELETE /invites/{invite} RouteDeleteInvite = func(invite string) Route { return Route{"DELETE", "/invites/" + url.PathEscape(invite)} } // API.FetchEmoji(emoji) -> GET /custom/emoji/{emoji} RouteFetchEmoji = func(emoji ULID) Route { return Route{"GET", "/custom/emoji/" + emoji.EncodeFP()} } // API.FetchEmoji(id) -> PUT /custom/emoji/{id} RouteCreateEmoji = func(id string) Route { return Route{"PUT", "/custom/emoji/" + url.PathEscape(id)} } // API.DeleteEmoji(emoji) -> DELETE /custom/emoji/{emoji} RouteDeleteEmoji = func(emoji ULID) Route { return Route{"DELETE", "/custom/emoji/" + emoji.EncodeFP()} } // API.FetchServerEmojis(server) -> GET /servers/{server}/emojis RouteFetchServerEmojis = func(server ULID) Route { return Route{"GET", "/servers/" + server.EncodeFP() + "/emojis"} } RouteQueryStats = func() Route { return Route{"GET", "/admin/stats"} } RouteGloballyFetchMessages = func() Route { return Route{"POST", "/admin/messages"} } // API.EditReport(report, params) -> PATCH /safety/reports/{report} RouteEditReport = func(report ULID) Route { return Route{"PATCH", "/safety/reports/" + report.EncodeFP()} } // API.FetchReport(report) -> GET /safety/reports/{report} RouteFetchReport = func(report ULID) Route { return Route{"GET", "/safety/reports/" + report.EncodeFP()} } // API.FetchReports() -> GET /safety/reports RouteFetchReports = func() Route { return Route{"GET", "/safety/reports"} } // API.ReportContent(content, additionalContext) -> POST /safety/report RouteReportContent = func() Route { return Route{"POST", "/safety/report"} } // API.FetchSnapshots(report) -> GET /safety/snapshot/{report} RouteFetchSnapshots = func(report ULID) Route { return Route{"GET", "/safety/snapshot/" + report.EncodeFP()} } // API.CreateStrike(user, reason) -> POST /safety/strikes RouteCreateStrike = func() Route { return Route{"POST", "/safety/strikes"} } // API.FetchStrikes(user) -> GET /safety/strikes/{user} RouteFetchStrikes = func(user ULID) Route { return Route{"GET", "/safety/strikes/" + user.EncodeFP()} } // API.EditStrike(strike, params) -> POST /safety/strikes/{strike} RouteEditStrike = func(strike ULID) Route { return Route{"POST", "/safety/strikes/" + strike.EncodeFP()} } // API.DeleteStrike(strike) -> DELETE /safety/strikes/{strike} RouteDeleteStrike = func(strike ULID) Route { return Route{"DELETE", "/safety/strikes/" + strike.EncodeFP()} } // API.CreateAccount(params) -> POST /auth/account/create RouteCreateAccount = func() Route { return Route{"POST", "/auth/account/create"} } // API.ResendVerification(email, captcha) -> POST /auth/account/reverify RouteResendVerification = func() Route { return Route{"POST", "/auth/account/reverify"} } // API.ConfirmAccountDeletion(token) -> PUT /auth/account/delete RouteConfirmAccountDeletion = func() Route { return Route{"PUT", "/auth/account/delete"} } // API.DeleteAccount() -> POST /auth/account/delete RouteDeleteAccount = func() Route { return Route{"POST", "/auth/account/delete"} } // API.FetchAccount() -> GET /auth/account RouteFetchAccount = func() Route { return Route{"GET", "/auth/account/"} } // API.DisableAccount() -> POST /auth/account/disable RouteDisableAccount = func() Route { return Route{"POST", "/auth/account/disable"} } // API.ChangePassword(password, currentPassword) -> PATCH /auth/account/change/password RouteChangePassword = func() Route { return Route{"PATCH", "/auth/account/change/password"} } // API.ChangeEmail(email, currentPassword) -> PATCH /auth/account/change/email RouteChangeEmail = func() Route { return Route{"PATCH", "/auth/account/change/email"} } // API.VerifyEmail(code) -> POST /auth/account/verify/{code} RouteVerifyEmail = func(code string) Route { return Route{"POST", "/auth/account/verify/" + url.PathEscape(code)} } // API.SendPasswordReset(email, captcha) -> POST /auth/account/reset_password RouteSendPasswordReset = func() Route { return Route{"POST", "/auth/account/reset_password"} } // API.PasswordReset(token, password, removeSessions) -> PATCH /auth/account/reset_password RoutePasswordReset = func() Route { return Route{"PATCH", "/auth/account/reset_password"} } // API.Login(params) -> POST /auth/session/login RouteLogin = func() Route { return Route{"POST", "/auth/session/login"} } // API.Logout() -> POST /auth/session/logout RouteLogout = func() Route { return Route{"POST", "/auth/session/logout"} } // API.FetchSessions() -> GET /auth/session/all RouteFetchSessions = func() Route { return Route{"GET", "/auth/session/all"} } // API.DeleteAllSessions(revokeSelf) -> DELETE /auth/session/all RouteDeleteAllSessions = func() Route { return Route{"DELETE", "/auth/session/all"} } // API.RevokeSession(session) -> DELETE /auth/session/{id} RouteRevokeSession = func(id string) Route { return Route{"DELETE", "/auth/session/" + url.PathEscape(id)} } // API.EditSession(session, friendlyName) -> PATCH /auth/session/{id} RouteEditSession = func(id string) Route { return Route{"PATCH", "/auth/session/" + url.PathEscape(id)} } // API.CheckOnboardingStatus() -> GET /onboard/hello RouteCheckOnboardingStatus = func() Route { return Route{"GET", "/onboard/hello"} } // API.CompleteOnboarding(username) -> POST /onboard/complete RouteCompleteOnboarding = func() Route { return Route{"POST", "/onboard/complete"} } // API.CreateMFATicket(params) -> PUT /auth/mfa/ticket RouteCreateMFATicket = func() Route { return Route{"PUT", "/auth/mfa/ticket"} } // API.FetchMFAStatus() -> GET /auth/mfa/ RouteFetchMFAStatus = func() Route { return Route{"GET", "/auth/mfa/"} } // API.FetchRecoveryCodes() -> POST /auth/mfa/recovery RouteFetchRecoveryCodes = func() Route { return Route{"POST", "/auth/mfa/recovery"} } // `API.GenerateRecoveryCodes()` -> `DELETE /auth/mfa/recovery` RouteGenerateRecoveryCodes = func() Route { return Route{"PATCH", "/auth/mfa/recovery"} } // API.GetMFAMethods() -> GET /auth/mfa/methods RouteGetMFAMethods = func() Route { return Route{"GET", "/auth/mfa/methods"} } // API.EnableTOTP2FA(params) -> PUT /auth/mfa/totp RouteEnableTOTP2FA = func() Route { return Route{"PUT", "/auth/mfa/totp"} } // API.GenerateTOTPSecre() -> POST /auth/mfa/totp RouteGenerateTOTPSecret = func() Route { return Route{"POST", "/auth/mfa/totp"} } // API.DisableTOTP2FA() -> DELETE /auth/mfa/totp RouteDisableTOTP2FA = func() Route { return Route{"DELETE", "/auth/mfa/totp"} } RouteFetchSettings = func() Route { return Route{"POST", "/sync/settings/fetch"} } RouteSetSettings = func() Route { return Route{"POST", "/sync/settings/set"} } // API.FetchUnreads() -> GET /sync/unreads RouteFetchUnreads = func() Route { return Route{"GET", "/sync/unreads"} } // API.PushSubscribe() -> POST /push/subscribe RoutePushSubscribe = func() Route { return Route{"POST", "/push/subscribe"} } // API.Unsubscribe() -> POST /push/unsubscribe RouteUnsubscribe = func() Route { return Route{"POST", "/push/unsubscribe"} } )
var ( AutumnRouteFetchConfig = func() Route { return Route{"GET", "/"} } AutumnRouteUpload = func(tag string) Route { return Route{"POST", "/" + url.PathEscape(tag)} } AutumnRouteGet = func(tag, id string) Route { return Route{"GET", "/" + url.PathEscape(tag) + "/" + url.PathEscape(id)} } )
Functions ¶
Types ¶
type API ¶
type API struct { Token *Token HTTPClient HTTPClient URL *url.URL Arshaler JSONArshaler }
func (*API) AcceptFriendRequest ¶
Accept another user's friend request. https://developers.revolt.chat/api/#tag/Relationships/operation/add_friend_req
func (*API) AcknowledgeMessage ¶
Lets the server and all other clients know that we've seen this message in this channel. https://developers.revolt.chat/api/#tag/Messaging/operation/channel_ack_req
func (*API) AddMemberToGroup ¶
Adds another user to the group. https://developers.revolt.chat/api/#tag/Groups/operation/group_add_member_req
func (*API) AddReactionToMessage ¶
React to a given message. https://developers.revolt.chat/api/#tag/Interactions/operation/message_react_react_message
func (*API) BanUser ¶
Ban a user by their ID. https://developers.revolt.chat/api/#tag/Server-Members/operation/ban_create_req
func (*API) BlockUser ¶
Block another user by their ID. https://developers.revolt.chat/api/#tag/Relationships/operation/block_user_req
func (*API) BulkDeleteMessages ¶
Delete multiple messages you've sent or one you have permission to delete. This will always require `ManageMessages` permission regardless of whether you own the message or not. Messages must have been sent within the past 1 week. ids [required] - Message IDs https://developers.revolt.chat/api/#tag/Messaging/operation/message_bulk_delete_req
func (*API) ChangeEmail ¶
Change the associated account email. email - Valid email address currentPassword - Current password https://developers.revolt.chat/api/#tag/Account/operation/change_email_change_email
func (*API) ChangePassword ¶
Change the current account password. password - New password currentPassword - Current password https://developers.revolt.chat/api/#tag/Account/operation/change_password_change_password
func (*API) ChangeUsername ¶
func (api *API) ChangeUsername(params *ChangeUsername) (u *User, err error)
Change your username. https://developers.revolt.chat/api/#tag/User-Information/operation/change_username_req
func (*API) CheckOnboardingStatus ¶
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. Return value - Whether onboarding is required https://developers.revolt.chat/api/#tag/Onboarding/operation/hello_req
func (*API) CloseChannel ¶
Deletes a server channel, leaves a group or closes a group. https://developers.revolt.chat/api/#tag/Channel-Information/operation/channel_delete_req
func (*API) CompleteOnboarding ¶
This sets a new username, completes onboarding and allows a user to start using Revolt. username [required] - New username which will be used to identify the user on the platform https://developers.revolt.chat/api/#tag/Onboarding/operation/complete_req
func (*API) ConfirmAccountDeletion ¶
Schedule an account for deletion by confirming the received token. https://developers.revolt.chat/api/#tag/Account/operation/confirm_deletion_confirm_deletion
func (*API) CreateAccount ¶
func (api *API) CreateAccount(params *CreateAccount) error
Create a new account. https://developers.revolt.chat/api/#tag/Account/operation/create_account_create_account
func (*API) CreateBot ¶
Create a new Revolt bot. name [required] - Bot username https://developers.revolt.chat/api/#tag/Bots/operation/create_create_bot
func (*API) CreateChannel ¶
func (api *API) CreateChannel(server ULID, params *CreateChannel) (c *Channel, err error)
Create a new Text or Voice channel. https://developers.revolt.chat/api/#tag/Server-Information/operation/channel_create_req
func (*API) CreateEmoji ¶
func (api *API) CreateEmoji(emoji string, params *CreateEmoji) (ce *CustomEmoji, err error)
Create an emoji by its Autumn upload ID. https://developers.revolt.chat/api/#tag/Emojis/operation/emoji_create_create_emoji
func (*API) CreateGroup ¶
func (api *API) CreateGroup(params *CreateGroup) (c *Channel, err error)
Create a new group channel. https://developers.revolt.chat/api/#tag/Groups/operation/group_create_req
func (*API) CreateInvite ¶
Creates an invite to this channel. Channel must be a `TextChannel`. https://developers.revolt.chat/api/#tag/Channel-Invites/operation/invite_create_req
func (*API) CreateMFATicket ¶
func (api *API) CreateMFATicket(params *MFAResponse) (t *MFATicket, err error)
Create a new MFA ticket or validate an existing one. https://developers.revolt.chat/api/#tag/MFA/operation/create_ticket_create_ticket
func (*API) CreateRole ¶
func (api *API) CreateRole(server ULID, params *CreateRole) (rr *RoleResponse, err error)
Creates a new server role. https://developers.revolt.chat/api/#tag/Server-Permissions/operation/roles_create_req
func (*API) CreateServer ¶
func (api *API) CreateServer(params *CreateServer) (sr *ServerResponse, err error)
Create a new server. https://developers.revolt.chat/api/#tag/Server-Information/operation/server_create_req
func (*API) CreateStrike ¶
Create a new account strike user [required] - ID of reported user reason [required] - Attached reason https://developers.revolt.chat/api/#tag/User-Safety/operation/create_strike_create_strike
func (*API) CreateWebhook ¶
Creates a webhook which 3rd party platforms can use to send messages. name [required] - The webhook name. avatar [optional, pass empty] - The webhook avatar. (Pass Autumn file ID) https://developers.revolt.chat/api/#tag/Webhooks/operation/webhook_create_req
func (*API) DeleteAccount ¶
Request to have an account deleted. https://developers.revolt.chat/api/#tag/Account/operation/delete_account_delete_account
func (*API) DeleteAllSessions ¶
Delete all active sessions, optionally including current one. https://developers.revolt.chat/api/#tag/Session/operation/revoke_all_revoke_all
func (*API) DeleteBot ¶
Delete a bot by its ID. https://developers.revolt.chat/api/#tag/Bots/operation/delete_delete_bot
func (*API) DeleteEmoji ¶
Delete an emoji by its ID. https://developers.revolt.chat/api/#tag/Emojis/operation/emoji_delete_delete_emoji
func (*API) DeleteInvite ¶
Delete an invite by its ID. https://developers.revolt.chat/api/#tag/Invites/operation/invite_delete_req
func (*API) DeleteMessage ¶
Delete a message you've sent or one you have permission to delete. https://developers.revolt.chat/api/#tag/Messaging/operation/message_delete_req
func (*API) DeleteRole ¶
Delete a server role by its ID. https://developers.revolt.chat/api/#tag/Server-Permissions/operation/roles_delete_req
func (*API) DeleteServer ¶
Deletes a server if owner. https://developers.revolt.chat/api/#tag/Server-Information/operation/server_delete_req
func (*API) DeleteStrike ¶
Delete a strike by its ID. https://developers.revolt.chat/api/#tag/User-Safety/operation/delete_strike_delete_strike
func (*API) DeleteWebhook ¶
Deletes a webhook [with a token]. webhook [required] - The webhook ID webhookToken [optional, pass empty] - The webhook private token.
func (*API) DenyFriendRequest ¶
Denies another user's friend request. https://developers.revolt.chat/api/#tag/Relationships/operation/remove_friend_req
func (*API) DisableAccount ¶
Disable an account. https://developers.revolt.chat/api/#tag/Account/operation/disable_account_disable_account
func (*API) DisableTOTP2FA ¶
Disable TOTP 2FA for an account. https://developers.revolt.chat/api/#tag/MFA/operation/totp_disable_totp_disable
func (*API) EditBot ¶
Edit bot details by its ID. https://developers.revolt.chat/api/#tag/Bots/operation/edit_edit_bot
func (*API) EditChannel ¶
func (api *API) EditChannel(channel ULID, params *EditChannel) (c *Channel, err error)
Edit a channel object by its id. https://developers.revolt.chat/api/#tag/Channel-Information/operation/channel_edit_req
func (*API) EditMember ¶
func (api *API) EditMember(server, member ULID, params *EditMember) (m *Member, err error)
Edit a member by their ID. https://developers.revolt.chat/api/#tag/Server-Members/operation/member_edit_req
func (*API) EditMessage ¶
func (api *API) EditMessage(channel, message ULID, params *EditMessage) (m *Message, err error)
Edits a message that you've previously sent. https://developers.revolt.chat/api/#tag/Messaging/operation/message_edit_req
func (*API) EditReport ¶
func (api *API) EditReport(report ULID, params *EditReport) (r *Report, err error)
Edit a report. https://developers.revolt.chat/api/#tag/User-Safety/operation/edit_report_edit_report
func (*API) EditRole ¶
Edit a role by its ID. https://developers.revolt.chat/api/#tag/Server-Permissions/operation/roles_edit_req
func (*API) EditServer ¶
func (api *API) EditServer(server ULID, params *EditServer) (s *Server, err error)
Edit a server by its ID. https://developers.revolt.chat/api/#tag/Server-Information/operation/server_edit_req
func (*API) EditSession ¶
Edit current session information. friendlyName [required] - Session friendly name https://developers.revolt.chat/api/#tag/Session/operation/edit_edit
func (*API) EditStrike ¶
func (api *API) EditStrike(strike ULID, params *EditStrike) error
Edit a strike by its ID. https://developers.revolt.chat/api/#tag/User-Safety/operation/edit_strike_edit_strike
func (*API) EditUser ¶
Edit currently authenticated user. https://developers.revolt.chat/api/#tag/User-Information/operation/edit_user_req
func (*API) EditWebhook ¶
func (api *API) EditWebhook(webhookID ULID, webhookToken string, params *EditWebhook) (w *Webhook, err error)
Edits a webhook [with a token]. webhook [required] - The webhook ID webhookToken [optional, pass empty] - The webhook private token. params [required] - What to change in webhook.
func (*API) EnableTOTP2FA ¶
func (api *API) EnableTOTP2FA(params *MFAResponse) error
Generate a new secret for TOTP. https://developers.revolt.chat/api/#tag/MFA/operation/totp_enable_totp_enable
func (*API) ExecuteWebhook ¶
func (api *API) ExecuteWebhook(webhook ULID, token string, params *SendMessage) (m *Message, err error)
Executes a webhook and sends a message. https://github.com/revoltchat/backend/blob/master/crates/delta/src/routes/webhooks/webhook_execute.rs (No OpenAPI docs)
func (*API) FetchAccount ¶
Fetch account information from the current session. https://developers.revolt.chat/api/#tag/Account/operation/fetch_account_fetch_account
func (*API) FetchBans ¶
func (api *API) FetchBans(server ULID) (br *BansResponse, err error)
Fetch all bans on a server. https://developers.revolt.chat/api/#tag/Server-Members/operation/ban_list_req
func (*API) FetchBot ¶
Fetch details of a bot you own by its id. https://developers.revolt.chat/api/#tag/Bots/operation/fetch_fetch_bot
func (*API) FetchChannel ¶
Fetch channel by its ID. https://developers.revolt.chat/api/#tag/Channel-Information/operation/channel_fetch_req
func (*API) FetchChannelWebhooks ¶
Fetches all webhooks inside the channel. https://developers.revolt.chat/api/#tag/Webhooks/operation/webhook_fetch_all_req
func (*API) FetchDefaultAvatar ¶
This returns a default avatar based on the given id. https://developers.revolt.chat/api/#tag/User-Information/operation/get_default_avatar_req
func (*API) FetchDirectMessageChannels ¶
This fetches your direct messages, including any DM and group DM conversations. https://developers.revolt.chat/api/#tag/Direct-Messaging/operation/fetch_dms_req
func (*API) FetchEmoji ¶
func (api *API) FetchEmoji(emoji ULID) (ce *CustomEmoji, err error)
Fetch an emoji by its ID. https://developers.revolt.chat/api/#tag/Emojis/operation/emoji_fetch_fetch_emoji
func (*API) FetchGroupMembers ¶
Retrieves all users who are part of this group. https://developers.revolt.chat/api/#tag/Groups/operation/members_fetch_req
func (*API) FetchInvite ¶
func (api *API) FetchInvite(invite string) (i *InviteResponse, err error)
Fetch an invite by its ID. https://developers.revolt.chat/api/#tag/Invites/operation/invite_fetch_req
func (*API) FetchInvites ¶
Fetch all server invites. https://developers.revolt.chat/api/#tag/Server-Members/operation/invites_fetch_req
func (*API) FetchMFAStatus ¶
Fetch MFA status of an account. https://developers.revolt.chat/api/#tag/MFA/operation/fetch_status_fetch_status
func (*API) FetchMember ¶
Retrieve a member. https://developers.revolt.chat/api/#tag/Server-Members/operation/member_fetch_req
func (*API) FetchMembers ¶
func (api *API) FetchMembers(server ULID, params *FetchMembers) (fmr *FetchMembersResponse, err error)
Fetch all server members. https://developers.revolt.chat/api/#tag/Server-Members/operation/member_fetch_all_req
func (*API) FetchMessage ¶
Retrieves a message by its id. https://developers.revolt.chat/api/#tag/Messaging/operation/message_fetch_req
func (*API) FetchMessages ¶
func (api *API) FetchMessages(channel ULID, params *FetchMessages) (m *Messages, err error)
Fetch multiple messages. https://developers.revolt.chat/api/#tag/Messaging/operation/message_query_req
func (*API) FetchMutualFriendsAndServers ¶
Retrieve a list of mutual friends and servers with another user. https://developers.revolt.chat/api/#tag/Relationships/operation/find_mutual_req
func (*API) FetchOwnedBots ¶
Fetch all of the bots that you have control over. https://developers.revolt.chat/api/#tag/Bots/operation/fetch_owned_fetch_owned_bots
func (*API) FetchPublicBot ¶
Fetch details of a public (or owned) bot by its id. https://developers.revolt.chat/api/#tag/Bots/operation/fetch_public_fetch_public_bot
func (*API) FetchRecoveryCodes ¶
Fetch recovery codes for an account. https://developers.revolt.chat/api/#tag/MFA/operation/fetch_recovery_fetch_recovery
func (*API) FetchReport ¶
Fetch a report by its ID. https://developers.revolt.chat/api/#tag/User-Safety/operation/fetch_report_fetch_report
func (*API) FetchReports ¶
func (api *API) FetchReports(params *FetchReports) (a []*Report, err error)
Fetch all available reports. https://developers.revolt.chat/api/#tag/User-Safety/operation/fetch_reports_fetch_reports
func (*API) FetchSelf ¶
Retrieve your user information. https://developers.revolt.chat/api/#tag/User-Information/operation/fetch_self_req
func (*API) FetchServer ¶
Fetch a server by its ID. https://developers.revolt.chat/api/#tag/Server-Information/operation/server_fetch_req
func (*API) FetchServerEmojis ¶
func (api *API) FetchServerEmojis(server ULID) (a []*CustomEmoji, err error)
Fetch all emojis on a server.
func (*API) FetchSessions ¶
Fetch all sessions associated with this account. https://developers.revolt.chat/api/#tag/Session/operation/fetch_all_fetch_all
func (*API) FetchSettings ¶
Fetch settings from server filtered by keys. This will return an object with the requested keys, each value is a `Setting` struct, the value is the previously uploaded data. keys [required] - Keys to fetch https://developers.revolt.chat/api/#tag/Sync/operation/get_settings_req
func (*API) FetchSnapshots ¶
Fetch a snapshots for a given report. https://developers.revolt.chat/api/#tag/User-Safety/operation/fetch_snapshots_fetch_snapshots
func (*API) FetchStrikes ¶
Fetch strikes for a user by their ID https://developers.revolt.chat/api/#tag/User-Safety/operation/fetch_strikes_fetch_strikes
func (*API) FetchUnreads ¶
func (api *API) FetchUnreads() (a []*UnreadMessage, err error)
Fetch information about unread state on channels. https://developers.revolt.chat/api/#tag/Sync/operation/get_unreads_req
func (*API) FetchUser ¶
Retrieve a user's information. https://developers.revolt.chat/api/#tag/User-Information/operation/fetch_user_req
func (*API) FetchUserFlags ¶
Retrieve a user's flags. https://developers.revolt.chat/api/#tag/User-Information/operation/fetch_user_flags_fetch_user_flags
func (*API) FetchUserProfile ¶
func (api *API) FetchUserProfile(user ULID) (p *UserProfile, err error)
Retrieve a user's profile data. Will fail if you do not have permission to access the other user's profile. https://developers.revolt.chat/api/#tag/User-Information/operation/fetch_profile_req
func (*API) FetchWebhook ¶
Fetches a webhook [with a token]. Requires valid API token if no webhook token passed. webhookID [required] - The webhook ID webhookToken [optional, pass empty] - The webhook private token.
func (*API) GenerateRecoveryCodes ¶
Re-generate recovery codes for an account. https://developers.revolt.chat/api/#tag/MFA/operation/generate_recovery_generate_recovery
func (*API) GenerateTOTPSecret ¶
Generate a new secret for TOTP. https://developers.revolt.chat/api/#tag/MFA/operation/totp_generate_secret_totp_generate_secret
func (*API) GetMFAMethods ¶
Fetch available MFA methods. https://developers.revolt.chat/api/#tag/MFA/operation/get_mfa_methods_get_mfa_methods
func (*API) GloballyFetchMessages ¶
func (api *API) GloballyFetchMessages(params *GloballyFetchMessages) (m *Messages, err error)
This is a privileged route to globally fetch messages. https://developers.revolt.chat/api/#tag/Admin/operation/message_query_message_query
func (*API) InviteBot ¶
Invite a bot to a server or group by its id. https://developers.revolt.chat/api/#tag/Bots/operation/invite_invite_bot
func (*API) JoinCall ¶
Asks the voice server for a token to join the call. https://developers.revolt.chat/api/#tag/Voice/operation/voice_join_req
func (*API) JoinInvite ¶
func (api *API) JoinInvite(invite string) (jir *JoinInviteResponse, err error)
Join an invite by its ID. https://developers.revolt.chat/api/#tag/Invites/operation/invite_join_req
func (*API) KickMember ¶
Removes a member from the server. https://developers.revolt.chat/api/#tag/Server-Members/operation/member_remove_req
func (*API) LeaveServer ¶
func (api *API) LeaveServer(server ULID, params *LeaveServer) (err error)
Leaves a server if not owner. https://developers.revolt.chat/api/#tag/Server-Information/operation/server_delete_req
func (*API) Login ¶
func (api *API) Login(params *Login) (lr *LoginResponse, err error)
Login to an account. https://developers.revolt.chat/api/#tag/Session/operation/login_login
func (*API) Logout ¶
Delete current session. https://developers.revolt.chat/api/#tag/Session/operation/logout_logout
func (*API) MarkServerAsRead ¶
Mark all channels in a server as read. https://developers.revolt.chat/api/#tag/Server-Information/operation/server_ack_req
func (*API) OpenDirectMessage ¶
Open a DM with another user. If the target is oneself, a saved messages channel is returned. https://developers.revolt.chat/api/#tag/Direct-Messaging/operation/open_dm_req
func (*API) PasswordReset ¶
Confirm password reset and change the password. token [required] - Reset token password [required] - New password https://developers.revolt.chat/api/#tag/Account/operation/password_reset_password_reset
func (*API) PushSubscribe ¶
func (api *API) PushSubscribe(params WebPushSubscription) error
Create a new Web Push subscription. If an existing subscription exists on this session, it will be removed. https://developers.revolt.chat/api/#tag/Web-Push/operation/subscribe_req
func (*API) QueryMembersByName ¶
Query members by a given name, this API is not stable and will be removed in the future. query [required] - String to search for https://developers.revolt.chat/api/#tag/Server-Members/operation/member_experimental_query_member_experimental_query
func (*API) QueryNode ¶
Fetch the server configuration for this Revolt instance. https://developers.revolt.chat/api/#tag/Core/operation/root_root
func (*API) QueryStats ¶
func (api *API) QueryStats() (st *InstanceStatistics, err error)
Fetch various technical statistics. https://developers.revolt.chat/api/#tag/Admin/operation/stats_stats
func (*API) RemoveAllReactionsFromMessage ¶
Remove your own, someone else's or all of a given reaction. Requires `ManageMessages` permission. https://developers.revolt.chat/api/#tag/Interactions/operation/message_clear_reactions_clear_reactions
func (*API) RemoveFriend ¶
Denies another user's friend request or removes an existing friend. https://developers.revolt.chat/api/#tag/Relationships/operation/remove_friend_req
func (*API) RemoveMemberFromGroup ¶
Removes a user from the group. https://developers.revolt.chat/api/#tag/Groups/operation/group_remove_member_req
func (*API) RemoveReactionsFromMessage ¶
Remove your own, someone else's or all of a given reaction. Requires `ManageMessages` if changing others' reactions. https://developers.revolt.chat/api/#tag/Interactions/operation/message_unreact_unreact_message
func (*API) ReportContent ¶
func (api *API) ReportContent(content *ReportContent, additionalContext string) error
Report a piece of content to the moderation team. content [required] - The content being reported. additionalContext [optional, pass empty] - Additional report description https://developers.revolt.chat/api/#tag/User-Safety/operation/report_content_report_content
func (*API) RequestJSON ¶
func (api *API) RequestJSON(v any, route Route, options *RequestOptions) error
func (*API) RequestNone ¶
func (api *API) RequestNone(route Route, options *RequestOptions) error
func (*API) ResendVerification ¶
Resend account creation verification email. email [required] - Email associated with the account captcha [optional, pass empty] - Captcha verification code https://developers.revolt.chat/api/#tag/Account/operation/resend_verification_resend_verification
func (*API) RevokeSession ¶
Delete a specific active session. https://developers.revolt.chat/api/#tag/Session/operation/revoke_revoke
func (*API) SearchForMessages ¶
func (api *API) SearchForMessages(channel ULID, params *SearchForMessages) (m *Messages, err error)
This route searches for messages within the given parameters. https://developers.revolt.chat/api/#tag/Messaging/operation/message_search_req
func (*API) SendFriendRequest ¶
Send a friend request to another user. username [required] - Username and discriminator combo separated by # https://developers.revolt.chat/api/#tag/Relationships/operation/send_friend_request_req
func (*API) SendMessage ¶
func (api *API) SendMessage(channel ULID, params *SendMessage) (m *Message, err error)
Sends a message to the given channel. https://developers.revolt.chat/api/#tag/Messaging/operation/message_send_message_send
func (*API) SendPasswordReset ¶
Send an email to reset account password. email [required] - Email associated with the account captcha [optional, pass empty string] - Captcha verification code https://developers.revolt.chat/api/#tag/Account/operation/send_password_reset_send_password_reset
func (*API) SetDefaultChannelPermission ¶
func (api *API) SetDefaultChannelPermission(channel ULID, params *SetDefaultPermission) (c *Channel, err error)
Sets permissions for the default role in this channel. Channel must be a `Group`, `TextChannel` or `VoiceChannel`. https://developers.revolt.chat/api/#tag/Channel-Permissions/operation/permissions_set_default_req
func (*API) SetDefaultServerPermission ¶
func (api *API) SetDefaultServerPermission(server ULID, params *SetDefaultPermission) (s *Server, err error)
Sets permissions for the default role in this server. https://developers.revolt.chat/api/#tag/Server-Permissions/operation/permissions_set_default_req
func (*API) SetRoleChannelPermission ¶
func (api *API) SetRoleChannelPermission(channel, role ULID, allow, deny Permissions) (c *Channel, err error)
Sets permissions for the specified role in this channel. Channel must be a `TextChannel` or `VoiceChannel`. https://developers.revolt.chat/api/#tag/Channel-Permissions/operation/permissions_set_req
func (*API) SetRoleServerPermission ¶
func (api *API) SetRoleServerPermission(server, role ULID, allow, deny Permissions) (s *Server, err error)
Sets permissions for the specified role in the server. allow [required] - Allow bit flags deny [required] - Disallow bit flags https://developers.revolt.chat/api/#tag/Server-Permissions/operation/permissions_set_req
func (*API) SetSettings ¶
Upload data to save to settings. timestamp [optional, pass zero] - Timestamp of settings change. Used to avoid feedback loops. https://developers.revolt.chat/api/#tag/Sync/operation/set_settings_req
func (*API) UnbanUser ¶
Remove a user's ban. https://developers.revolt.chat/api/#tag/Server-Members/operation/ban_remove_req
func (*API) UnblockUser ¶
Unblock another user by their ID. https://developers.revolt.chat/api/#tag/Relationships/operation/unblock_user_req
func (*API) Unsubscribe ¶
Remove the Web Push subscription associated with the current session. https://developers.revolt.chat/api/#tag/Web-Push/operation/unsubscribe_req
func (*API) VerifyEmail ¶
Verify an email address. ticket - May be nil https://developers.revolt.chat/api/#tag/Account/operation/verify_email_verify_email
type APIConfig ¶
type APIConfig struct { HTTPClient HTTPClient URL *url.URL Arshaler JSONArshaler }
type APIError ¶
type APIError struct { Response *http.Response `json:"-"` Type string `json:"type"` RetryAfter float64 `json:"retry_after"` Err string `json:"error"` Max int `json:"max"` Permission string `json:"permission"` Operation string `json:"operation"` Collection string `json:"collection"` Location string `json:"location"` With string `json:"with"` }
type ArshalNotImplemented ¶
type ArshalNotImplemented struct{}
func (ArshalNotImplemented) Error ¶
func (ArshalNotImplemented) Error() string
type Auth ¶
type Auth struct { EventType AuthEventType `json:"event_type"` // [Present only on CreateAccount] Account *SocketAccount `json:"account,omitempty"` // [Present only on CreateSession] Session *SocketSession `json:"session,omitempty"` // [Present only on DeleteSession/DeleteAllSessions] UserID ULID `json:"user_id,omitempty"` // [Present only on DeleteSession] SessionID string `json:"session_id,omitempty"` // [Present only on DeleteAllSessions] ExcludeSessionID string `json:"exclude_session_id,omitempty"` }
Forwarded events from rAuth, currently only session deletion events are forwarded.
type AuthEventType ¶
type AuthEventType string
const ( AuthEventTypeCreateAccount AuthEventType = "CreateAccount" AuthEventTypeCreateSession AuthEventType = "CreateSession" AuthEventTypeDeleteSession AuthEventType = "DeleteSession" AuthEventTypeDeleteAllSessions AuthEventType = "DeleteAllSessions" )
type Authenticated ¶
type Authenticated struct{}
The server has authenticated your connection and you will shortly start receiving data.
type AutumnAPI ¶
type AutumnAPI struct { Token *Token HTTPClient HTTPClient URL *url.URL Arshaler JSONArshaler }
Requester for Autumn API
func NewAutumnAPI ¶
func NewAutumnAPI(token *Token, config *AutumnAPIConfig) (api *AutumnAPI, err error)
NewAutumnAPI returns an AutumnAPI which can be used to upload and get files
func (*AutumnAPI) FetchConfig ¶
func (api *AutumnAPI) FetchConfig() (c *AutumnConfig, err error)
func (*AutumnAPI) Get ¶
Get file from Autumn. tag [required] - tag, valid tags are: ["attachments", "avatars", "backgrounds", "icons", "banners", "emojis"] id [required] - file ID Example: `id, err := autumn.Get("attachments", "123")`
func (*AutumnAPI) RequestJSON ¶
func (api *AutumnAPI) RequestJSON(v any, route Route, options *RequestOptions) error
func (*AutumnAPI) Upload ¶
func (api *AutumnAPI) Upload(tag UploadTag, filename, contentType string, contents []byte) (s string, err error)
Upload file to Autumn. tag [required] - tag, valid tags are: ["attachments", "avatars", "backgrounds", "banners", "emojis", "icons"] filename [required] - filename that will displayed in client contentType [optional, pass empty] - content type contents [required] - the file contents Example: `id, err := autumn.Upload("attachments", "hello.txt", "", []byte("hello world"))`
type AutumnAPIConfig ¶
type AutumnAPIConfig struct { HTTPClient HTTPClient URL *url.URL Arshaler JSONArshaler }
Requester config
type AutumnConfig ¶
type AutumnFile ¶
type AutumnFile struct { // Unique ID ID string `json:"_id"` // Tag / bucket this file was uploaded to Tag string `json:"tag"` // Original filename Filename string `json:"filename"` // Metadata associated with file Metadata AutumnFileMetadata `json:"metadata"` // Raw content type of this file ContentType string `json:"content_type"` // Size of this file (in bytes) Size int `json:"size"` // Whether this file was deleted Deleted *bool `json:"deleted"` // Whether this file was reported Reported *bool `json:"reported"` MessageID ULID `json:"message_id"` UserID ULID `json:"user_id"` ServerID ULID `json:"server_id"` // ID of the object this file is associated with ObjectID ULID `json:"object_id"` }
Representation of a File on Revolt Generated by Autumn
func (*AutumnFile) ToOptimized ¶
func (o *AutumnFile) ToOptimized() *OptimizedAutumnFile
type AutumnFileMetadata ¶
type AutumnFileMetadata struct { Type AutumnFileMetadataType `json:"type"` Width int `json:"width"` Height int `json:"height"` }
func (*AutumnFileMetadata) ToOptimized ¶
func (o *AutumnFileMetadata) ToOptimized() *OptimizedAutumnFileMetadata
type AutumnFileMetadataType ¶
type AutumnFileMetadataType string
const ( AutumnFileMetadataTypeFile AutumnFileMetadataType = "File" AutumnFileMetadataTypeText AutumnFileMetadataType = "Text" AutumnFileMetadataTypeImage AutumnFileMetadataType = "Image" AutumnFileMetadataTypeVideo AutumnFileMetadataType = "Video" AutumnFileMetadataTypeAudio AutumnFileMetadataType = "Audio" )
func (AutumnFileMetadataType) ToOptimized ¶
func (s AutumnFileMetadataType) ToOptimized() OptimizedAutumnFileMetadataType
type BansResponse ¶
type Bot ¶
type Bot struct { // Bot ID. This equals the associated bot user's ID. ID ULID `json:"_id"` // User ID of the bot owner Owner ULID `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 BotFlags `json:"flags"` }
type BuildInformation ¶
type BulkDeleteMessage ¶
type BulkDeleteMessage struct { // Where messages were deleted. ChannelID ULID `json:"channel_id"` // Affected message IDs. IDs []ULID `json:"ids"` }
Multiple messages were deleted.
type Cache1 ¶
type Cache1[T Cacheable] struct { Checker Cache1Checker[T] DontInsertIfOverflow bool MaxSize int Cache map[ULID]*T }
func (*Cache1[T]) PartiallyUpdate ¶
type Cache1CheckContext ¶
type Cache1Checker ¶
type Cache1Checker[T Cacheable] interface { CanCache1(*Cache1CheckContext[T]) bool }
type Cache2 ¶
type Cache2[T Cacheable] struct { Checker Cache2Checker[T] MaxSize1 int MaxSize2 int TotalMaxSize int DontInsertIfOverflow bool Cache map[ULID]map[ULID]*T // contains filtered or unexported fields }
func (*Cache2[T]) GroupsCount ¶
func (*Cache2[T]) PartiallyUpdate ¶
type Cache2CheckContext ¶
type Cache2Checker ¶
type Cache2Checker[T Cacheable] interface { CanCache2(*Cache2CheckContext[T]) bool }
type ChangeUsername ¶
type Channel ¶
type Channel struct { Type ChannelType `json:"channel_type"` // Unique ID ID ULID `json:"_id"` // ID of the server this channel belongs to Server ULID `json:"server,omitempty"` // Display name of the channel Name string `json:"name,omitempty"` // Whether this direct message channel is currently open on both sides Active bool `json:"active"` // User ID of the owner of the group Owner ULID `json:"owner,omitempty"` // Channel description Description string `json:"description,omitempty"` Icon *AutumnFile `json:"icon,omitempty"` // 2-tuple of user ids participating in direct message / Array of user ids participating in channel Recipients []ULID `json:"recipients,omitempty"` // ID of the last message sent in this channel LastMessageID ULID `json:"last_message_id,omitempty"` // Permissions assigned to members of this group (does not apply to the owner of the group) Permissions Permissions `json:"permissions,omitempty"` // Representation of a single permission override as it appears on models and in the database DefaultPermissions *PermissionOverride `json:"default_permissions,omitempty"` // Permissions assigned based on role to this channel RolePermissions map[ULID]PermissionOverride `json:"role_permissions,omitempty"` // ID of the user this channel belongs to User ULID `json:"user,omitempty"` // Whether this group is marked as not safe for work NSFW bool `json:"nsfw,omitempty"` }
func (*Channel) ToOptimized ¶
func (c *Channel) ToOptimized() *OptimizedChannel
type ChannelAck ¶
type ChannelAck struct { ChannelID ULID `json:"id"` User ULID `json:"user"` MessageID ULID `json:"message_id"` }
You have acknowledged new messages in this channel up to this message ID.
type ChannelDelete ¶
type ChannelDelete struct {
ChannelID ULID `json:"id"`
}
Channel has been deleted.
type ChannelGroupJoin ¶
A user has joined the group.
type ChannelGroupLeave ¶
A user has left the group.
type ChannelStartTyping ¶
A user has started typing in this channel.
type ChannelStopTyping ¶
A user has stopped typing in this channel.
type ChannelType ¶
type ChannelType string
const ( ChannelTypeSavedMessages ChannelType = "SavedMessages" ChannelTypeDirectMessage ChannelType = "DirectMessage" ChannelTypeGroup ChannelType = "Group" ChannelTypeTextChannel ChannelType = "TextChannel" ChannelTypeVoiceChannel ChannelType = "VoiceChannel" )
func (ChannelType) ToOptimized ¶
func (ct ChannelType) ToOptimized() OptimizedChannelType
type ChannelUpdate ¶
type ChannelUpdate struct { ChannelID ULID `json:"id"` Data *PartialChannel `json:"data"` // Possible values: ["Description", "Icon", "DefaultPermissions"] Clear []string `json:"clear"` }
Channel details updated.
func (*ChannelUpdate) IsDefaultPermissionsWereRemoved ¶
func (cu *ChannelUpdate) IsDefaultPermissionsWereRemoved() bool
Whether default permissions were removed.
func (*ChannelUpdate) IsDescriptionCleared ¶
func (cu *ChannelUpdate) IsDescriptionCleared() bool
Whether description was cleared.
func (*ChannelUpdate) IsIconRemoved ¶
func (cu *ChannelUpdate) IsIconRemoved() bool
Whether icon was removed.
type CollectionScans ¶
type CollectionStats ¶
type CollectionStats struct { // Namespace Namespace string `json:"ns"` LocalTime Time `json:"localTime"` // Latency stats LatencyStats map[string]*LatencyStats `json:"latencyStats"` // Collection query execution stats QueryExecStats QueryExecStats `json:"queryExecStaus"` // Number of documents in collection Count uint64 `json:"count"` }
type CreateAccount ¶
type CreateChannel ¶
type CreateChannel struct { // Default: "Text" // Enum: "Text" "Voice" // Channel type Type ChannelType `json:"type,omitempty"` // Channel name Name string `json:"name"` // Channel description Description string `json:"description,omitempty"` // Whether this channel is age restricted NSFW bool `json:"nsfw"` }
type CreateEmoji ¶
type CreateEmoji struct { // Emoji name Name string `json:"name"` // Information about what owns this emoji Parent CustomEmojiParent `json:"parent"` // Whether the emoji is mature NSFW bool `json:"nsfw"` }
type CreateGroup ¶
type CreateGroup 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 []ULID `json:"users"` // Whether this group is age-restricted NSFW bool `json:"nsfw"` }
type CreateRole ¶
type CreateServer ¶
type CustomEmoji ¶
type CustomEmoji struct { // Unique ID ID ULID `json:"_id"` // What owns this emoji Parent CustomEmojiParent `json:"parent"` // Uploader user ID CreatorID ULID `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"` }
func (*CustomEmoji) ToOptimized ¶
func (e *CustomEmoji) ToOptimized() *OptimizedCustomEmoji
type CustomEmojiParent ¶
type CustomEmojiParent struct { Type CustomEmojiParentType `json:"type"` ID ULID `json:"id,omitempty"` }
Information about what owns this emoji
func (*CustomEmojiParent) ToOptimized ¶
func (o *CustomEmojiParent) ToOptimized() *OptimizedCustomEmojiParent
type CustomEmojiParentType ¶
type CustomEmojiParentType string
const ( CustomEmojiParentTypeServer CustomEmojiParentType = "Server" CustomEmojiParentTypeDetached CustomEmojiParentType = "Detached" )
func (CustomEmojiParentType) ToOptimized ¶
func (typ CustomEmojiParentType) ToOptimized() OptimizedCustomEmojiParentType
type DefaultHTTPClient ¶
func NewDefaultHTTPClient ¶
func NewDefaultHTTPClient(client http.Client) DefaultHTTPClient
type DefaultWebsocketDialer ¶
func NewDefaultWebsocketDialer ¶
func NewDefaultWebsocketDialer(dialer *websocket.Dialer) DefaultWebsocketDialer
type DeletionInfo ¶
type DeletionInfo struct { Token string `json:"token,omitempty"` Expiry *Time `json:"expiry,omitempty"` After *Time `json:"after,omitempty"` }
Account deletion information
type DeletionInfoStatus ¶
type DeletionInfoStatus string
const ( // The user must confirm deletion by email DeletionInfoStatusWaitingForVerification DeletionInfoStatus = "WaitingForVerification" // The account is scheduled for deletion DeletionInfoStatusScheduled DeletionInfoStatus = "Scheduled" // This account was deleted DeletionInfoStatusDeleted DeletionInfoStatus = "Deleted" )
type EditBot ¶
type EditBot 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. Analytics *bool `json:"analytics,omitempty"` // Interactions URL InteractionsURL *string `json:"interactions_url,omitempty"` // Fields to remove from bot object // Possible values: ["Token", "InteractionsURL"] Remove []string `json:"remove,omitempty"` }
func (*EditBot) RemoveInteractionsURL ¶
Indicate that we will remove interactions URL.
func (*EditBot) RemoveToken ¶
Indicate that we will remove token.
type EditChannel ¶
type EditChannel struct { // Channel name Name string `json:"name,omitempty"` // Channel description Description *string `json:"description,omitempty"` // Group owner Owner ULID `json:"owner,omitempty"` // Icon to set. 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 channel object // Possible values: ["Description", "Icon", "DefaultPermissions"] Remove []string `json:"remove,omitempty"` }
func (*EditChannel) RemoveDefaultPermissions ¶
func (ec *EditChannel) RemoveDefaultPermissions() *EditChannel
Indicate that we will remove default permissions.
func (*EditChannel) RemoveDescription ¶
func (ec *EditChannel) RemoveDescription() *EditChannel
Indicate that we will remove description.
func (*EditChannel) RemoveIcon ¶
func (ec *EditChannel) RemoveIcon() *EditChannel
Indicate that we will remove icon.
type EditMember ¶
type EditMember struct { // Member nickname Nickname string `json:"nickname,omitempty"` // Attachment ID to set for avatar Avatar string `json:"avatar,omitempty"` // Array of role IDs Roles *[]ULID `json:"roles,omitempty"` // ISO8601 formatted timestamp Timeout *Time `json:"timeout,omitempty"` // Fields to remove from member object // Possible values: ["Nickname", "Avatar", "Roles", "Timeout"] Remove []string `json:"remove,omitempty"` }
func (*EditMember) RemoveAvatar ¶
func (em *EditMember) RemoveAvatar() *EditMember
Indicate that we will remove avatar.
func (*EditMember) RemoveNickname ¶
func (em *EditMember) RemoveNickname() *EditMember
Indicate that we will remove nickname.
func (*EditMember) RemoveRoles ¶
func (em *EditMember) RemoveRoles() *EditMember
Indicate that we will remove roles.
func (*EditMember) RemoveTimeout ¶
func (em *EditMember) RemoveTimeout() *EditMember
Indicate that we will remove timeout.
type EditMessage ¶
type EditMessage struct { // New message content Content *string `json:"content,omitempty"` // Embeds to include in the message Embeds *[]SendableEmbed `json:"embeds,omitempty"` }
func (*EditMessage) AddEmbeds ¶
func (em *EditMessage) AddEmbeds(embeds ...SendableEmbed) *EditMessage
func (*EditMessage) SetContent ¶
func (em *EditMessage) SetContent(content string) *EditMessage
func (*EditMessage) SetEmbeds ¶
func (em *EditMessage) SetEmbeds(embeds *[]SendableEmbed) *EditMessage
func (*EditMessage) UnsetContent ¶
func (em *EditMessage) UnsetContent() *EditMessage
func (*EditMessage) UnsetEmbeds ¶
func (em *EditMessage) UnsetEmbeds() *EditMessage
type EditProfile ¶
type EditReport ¶
type EditReport struct { // Status of the report Status *EditReportStatus `json:"status,omitempty"` // Report notes Notes string `json:"notes,omitempty"` }
type EditReportStatus ¶
type EditReportStatus struct { Status ReportStatus `json:"status"` RejectionReason string `json:"rejection_reason,omitempty"` ClosedAt *Time `json:"closed_at,omitempty"` }
type EditRole ¶
type EditRole 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 *int `json:"rank,omitempty"` // Fields to remove from role object // Possible values: ["Colour"] Remove []string `json:"remove,omitempty"` }
func (*EditRole) RemoveColour ¶
Indicate that we will remove colour.
type EditServer ¶
type EditServer 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 channel assignments SystemMessages *EditSystemMessages `json:"system_messages,omitempty"` // Bitfield of server flags Flags ServerFlags `json:"flags,omitempty"` // Whether this server is public and should show up on Revolt Discover Discoverable *bool `json:"discoverable,omitempty"` // Whether analytics should be collected for this server // Must be enabled in order to show up on Revolt Discover. Analytics *bool `json:"analytics,omitempty"` // Fields to remove from server object // Possible values: ["Description", "Categories", "SystemMessages", "Icon", "Banner"] Remove []string `json:"remove,omitempty"` }
func (*EditServer) AddCategories ¶
func (es *EditServer) AddCategories(categories ...Category) *EditServer
func (*EditServer) RemoveBanner ¶
func (es *EditServer) RemoveBanner() *EditServer
Indicate that we will remove banner.
func (*EditServer) RemoveCategories ¶
func (es *EditServer) RemoveCategories() *EditServer
Indicate that we will remove categories.
func (*EditServer) RemoveDescription ¶
func (es *EditServer) RemoveDescription() *EditServer
Indicate that we will remove description.
func (*EditServer) RemoveIcon ¶
func (es *EditServer) RemoveIcon() *EditServer
Indicate that we will remove icon.
func (*EditServer) RemoveSystemMessages ¶
func (es *EditServer) RemoveSystemMessages() *EditServer
Indicate that we will remove system messages.
func (*EditServer) SetCategories ¶
func (es *EditServer) SetCategories(categories *[]Category) *EditServer
func (*EditServer) SetDescription ¶
func (es *EditServer) SetDescription(description string) *EditServer
func (*EditServer) SetFlags ¶
func (es *EditServer) SetFlags(flags ServerFlags) *EditServer
func (*EditServer) SetIcon ¶
func (es *EditServer) SetIcon(icon string) *EditServer
func (*EditServer) SetName ¶
func (es *EditServer) SetName(name string) *EditServer
func (*EditServer) SetSystemMessages ¶
func (es *EditServer) SetSystemMessages(systemMessages EditSystemMessages) *EditServer
func (*EditServer) UnsetCategories ¶
func (es *EditServer) UnsetCategories() *EditServer
func (*EditServer) UnsetDescription ¶
func (es *EditServer) UnsetDescription() *EditServer
func (*EditServer) UnsetIcon ¶
func (es *EditServer) UnsetIcon() *EditServer
func (*EditServer) UnsetName ¶
func (es *EditServer) UnsetName() *EditServer
func (*EditServer) UnsetSystemMessages ¶
func (es *EditServer) UnsetSystemMessages() *EditServer
type EditStrike ¶
type EditStrike struct { // New attached reason Reason string `json:"reason,omitempty"` }
type EditSystemMessages ¶
type EditSystemMessages struct { // ID of channel to send user join messages in UserJoined *ULID // ID of channel to send user left messages in UserLeft *ULID // ID of channel to send user kicked messages in UserKicked *ULID // ID of channel to send user banned messages in UserBanned *ULID }
func (EditSystemMessages) MarshalJSON ¶
func (esm EditSystemMessages) MarshalJSON() ([]byte, error)
type EditUser ¶
type EditUser struct { // New display name DisplayName *string // Attachment ID for avatar Avatar *string // User's active status Status *UserStatus // New user profile data. This is applied as a partial. Profile *EditProfile // Bitfield of user badges Badges UserBadges // Enum of user flags Flags UserFlags // Fields to remove from user object // Possible values: ["Avatar", "StatusText", "StatusPresence", "ProfileContent", "ProfileBackground", "DisplayName"] Remove []string }
func (EditUser) MarshalJSON ¶
func (*EditUser) RemoveAvatar ¶
Indicate that we will remove avatar.
func (*EditUser) RemoveDisplayName ¶
Indicate that we will remove display name.
func (*EditUser) RemoveProfileBackground ¶
Indicate that we will remove profile background.
func (*EditUser) RemoveProfileContent ¶
Indicate that we will remove profile content.
func (*EditUser) RemoveStatusPresence ¶
Indicate that we will remove status presence.
func (*EditUser) RemoveStatusText ¶
Indicate that we will remove status text.
type EditWebhook ¶
type EditWebhook struct { // New webhook name Name string `json:"name,omitempty"` // New avatar ID Avatar string `json:"avatar,omitempty"` // New webhook permissions Permissions *Permissions `json:"permissions,omitempty"` // Fields to remove from webhook // Possible values: ["Avatar"] Remove []string `json:"remove,omitempty"` }
func (*EditWebhook) RemoveAvatar ¶
func (ew *EditWebhook) RemoveAvatar() *EditWebhook
Indicate that we will remove avatar.
type EmailVerification ¶
type EmailVerification struct { Status EmailVerificationStatus `json:"status"` // [Present only on Moving] New email NewEmail string `json:"new_email,omitempty"` // [Present only on Pending/Moving] New token Token string `json:"token,omitempty"` // [Present only on Pending/Moving] Time at which this token expires Expiry *Time `json:"expiry,omitempty"` }
Email verification status
type EmailVerificationStatus ¶
type EmailVerificationStatus string
const ( // Account is verified EmailVerificationStatusVerified EmailVerificationStatus = "Verified" // Pending email verification EmailVerificationStatusPending EmailVerificationStatus = "Pending" // Moving to a new email EmailVerificationStatusMoving EmailVerificationStatus = "Moving" )
type Embed ¶
type Embed struct { Type EmbedType `json:"type"` // Direct URL to web page / URL to the original image / URL to the original video / URL for title URL string `json:"url"` // Original direct URL OriginalURL string `json:"original_url"` // Information about special remote content Special *EmbedSpecial `json:"special"` // Title of website / Title of text embed Title string `json:"title"` // Description of website / Description of text embed Description string `json:"description"` // Image Image *EmbedImage `json:"image"` // Video Video *EmbedVideo `json:"video"` // Site name SiteName string `json:"site_name"` // URL to site icon / URL to icon IconURL string `json:"icon_url"` Media *AutumnFile `json:"media"` // CSS Colour Colour string `json:"colour"` // Width of the image / Width of the video Width int `json:"width"` // Height of the image / Height of the video Height int `json:"height"` // Image positioning and size Size EmbedImageSize `json:"size"` }
func (*Embed) ToOptimized ¶
func (o *Embed) ToOptimized() *OptimizedEmbed
type EmbedImage ¶
type EmbedImage struct { URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` Size EmbedImageSize `json:"size"` }
func (*EmbedImage) ToOptimized ¶
func (o *EmbedImage) ToOptimized() *OptimizedEmbedImage
type EmbedImageSize ¶
type EmbedImageSize string
const ( EmbedImageSizeLarge EmbedImageSize = "Large" EmbedImageSizePreview EmbedImageSize = "Preview" )
func (EmbedImageSize) ToOptimized ¶
func (s EmbedImageSize) ToOptimized() OptimizedEmbedImageSize
type EmbedSpecial ¶
type EmbedSpecial struct { Type EmbedSpecialType `json:"type"` ID string `json:"id"` // Type of remote Lightspeed.tv content / Type of remote Twitch content / Type of remote Bandcamp content ContentType string `json:"content_type"` Timestamp string `json:"timestamp"` }
func (*EmbedSpecial) ToOptimized ¶
func (o *EmbedSpecial) ToOptimized() *OptimizedEmbedSpecial
type EmbedSpecialType ¶
type EmbedSpecialType string
const ( EmbedSpecialTypeNone EmbedSpecialType = "None" EmbedSpecialTypeGIF EmbedSpecialType = "GIF" EmbedSpecialTypeYouTube EmbedSpecialType = "YouTube" EmbedSpecialTypeLightspeed EmbedSpecialType = "Lightspeed" EmbedSpecialTypeTwitch EmbedSpecialType = "Twitch" EmbedSpecialTypeSpotify EmbedSpecialType = "Spotify" EmbedSpecialTypeSoundcloud EmbedSpecialType = "Soundcloud" EmbedSpecialTypeBandcamp EmbedSpecialType = "Bandcamp" EmbedSpecialTypeStreamable EmbedSpecialType = "Streamable" )
func (EmbedSpecialType) ToOptimized ¶
func (s EmbedSpecialType) ToOptimized() OptimizedEmbedSpecialType
type EmbedType ¶
type EmbedType string
func (EmbedType) ToOptimized ¶
func (s EmbedType) ToOptimized() OptimizedEmbedType
type EmbedVideo ¶
type EventController ¶
type EventController[T any] struct { // contains filtered or unexported fields }
func NewEventController ¶
func NewEventController[T any]() *EventController[T]
func (*EventController[T]) Emit ¶
func (ec *EventController[T]) Emit(t T) *EventController[T]
func (*EventController[T]) EmitAndCall ¶
func (ec *EventController[T]) EmitAndCall(t T, f func(T)) *EventController[T]
func (*EventController[T]) EmitInGoroutines ¶
func (ec *EventController[T]) EmitInGoroutines(t T) *EventController[T]
func (*EventController[T]) Listen ¶
func (ec *EventController[T]) Listen(f func(T)) *Subscription[T]
func (*EventController[T]) Override ¶
func (ec *EventController[T]) Override(f func(T)) *Subscription[T]
type Events ¶
type Events struct { Error *EventController[error] RevoltError *EventController[string] Authenticated *EventController[*Authenticated] Raw *EventController[map[string]any] Ready *EventController[*Ready] // Message received, the event object has the same schema as the Message object in the API with the addition of an event type. Message *EventController[*Message] MessageUpdate *EventController[*MessageUpdate] MessageAppend *EventController[*MessageAppend] MessageDelete *EventController[*MessageDelete] MessageReact *EventController[*MessageReact] MessageUnreact *EventController[*MessageUnreact] MessageRemoveReaction *EventController[*MessageRemoveReaction] BulkDeleteMessage *EventController[*BulkDeleteMessage] // Channel created, the event object has the same schema as the Channel object in the API with the addition of an event type. ChannelCreate *EventController[*Channel] ChannelUpdate *EventController[*ChannelUpdate] ChannelDelete *EventController[*ChannelDelete] ChannelGroupJoin *EventController[*ChannelGroupJoin] ChannelGroupLeave *EventController[*ChannelGroupLeave] ChannelStartTyping *EventController[*ChannelStartTyping] ChannelStopTyping *EventController[*ChannelStopTyping] ChannelAck *EventController[*ChannelAck] ServerCreate *EventController[*ServerCreate] ServerUpdate *EventController[*ServerUpdate] ServerDelete *EventController[*ServerDelete] ServerMemberUpdate *EventController[*ServerMemberUpdate] ServerMemberJoin *EventController[*ServerMemberJoin] ServerMemberLeave *EventController[*ServerMemberLeave] ServerRoleUpdate *EventController[*ServerRoleUpdate] ServerRoleDelete *EventController[*ServerRoleDelete] UserUpdate *EventController[*UserUpdate] UserRelationship *EventController[*UserRelationship] UserSettingsUpdate *EventController[*UserSettingsUpdate] UserPlatformWipe *EventController[*UserPlatformWipe] // Emoji created, the event object has the same schema as the Emoji object in the API with the addition of an event type. EmojiCreate *EventController[*CustomEmoji] EmojiDelete *EventController[*EmojiDelete] // Webhook created, the event object has the same schema as the Webhook object in the API with the addition of an event type. WebhookCreate *EventController[*Webhook] WebhookUpdate *EventController[*WebhookUpdate] WebhookDelete *EventController[*WebhookDelete] // Report created, the event object has the same schema as the Report object in the API with the addition of an event type. ReportCreate *EventController[*Report] Auth *EventController[*Auth] }
type FeatureConfiguration ¶
type FeatureConfiguration struct { /// hCaptcha configuration Captcha HCaptchaConfiguration `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 GenericServiceConfiguration `json:"autumn"` // Proxy service configuration January GenericServiceConfiguration `json:"january"` // Voice server configuration Voso VoiceServerConfiguration `json:"voso"` }
type FetchMembers ¶
type FetchMembers struct { // Whether to exclude offline users ExcludeOffline *bool }
type FetchMembersResponse ¶
type FetchMessages ¶
type FetchMessages struct { // Maximum number of messages to fetch // For fetching nearby messages, this is `(limit + 1)`. Limit int // Message id before which messages should be fetched Before ULID // Message id after which messages should be fetched After ULID // Message sort direction Sort MessageSort // 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 ULID // Whether to include user (and member, if server channel) objects IncludeUsers *bool }
type FetchReports ¶
type FetchReports struct { // Find reports aganist messages, servers, or users ContentID ULID // Find reports created by user AuthorID ULID // Report status to include in search Status ReportStatus }
type GenericCache ¶
type GenericCache struct { Channels *Cache1[OptimizedChannel] Emojis *Cache1[OptimizedCustomEmoji] Messages *Cache2[OptimizedMessage] Members *Cache2[Member] Roles *Cache2[OptimizedRole] Servers *Cache1[OptimizedServer] Users *Cache1[OptimizedUser] Webhooks *Cache1[OptimizedWebhook] }
type GloballyFetchMessages ¶
type GloballyFetchMessages struct { // Message ID before which messages should be fetched Before ULID `json:"before,omitempty"` // Message ID after which messages should be fetched After ULID `json:"after,omitempty"` // Sort used for retrieving messages 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 ULID `json:"nearby,omitempty"` // Maximum number of messages to fetch // For fetching nearby messages, this is `(limit + 1)`. Limit int `json:"limit,omitempty"` // Parent channel ID Channel ULID `json:"channel,omitempty"` // Message author ID Author ULID `json:"author,omitempty"` // Search query Query string `json:"query,omitempty"` }
type HCaptchaConfiguration ¶
type Index ¶
type Index struct { // Index name Name string `json:"name"` // Index access information Accesses IndexAccesses `json:"accesses"` }
type IndexAccesses ¶
type InstanceStatistics ¶
type InstanceStatistics struct { // Index usage information Indices map[string]*Index `json:"indices"` // Collection stats CollStats map[string]*CollectionStats `json:"coll_stats"` }
type Invite ¶
type Invite struct { Type InviteType `json:"type"` // Invite code ID string `json:"_id"` // ID of the server this invite points to Server ULID `json:"server"` // ID of user who created this invite Creator ULID `json:"creator"` // ID of the server channel this invite points to / ID of the group channel this invite points to Channel ULID `json:"channel"` }
type InviteResponse ¶
type InviteResponse struct { Type InviteType `json:"type"` // Invite code Code string `json:"code"` // ID of the server ServerID ULID `json:"server_id"` // Name of the server ServerName string `json:"server_name"` ServerIcon *AutumnFile `json:"server_icon"` ServerBanner *AutumnFile `json:"server_banner"` // Enum of server flags ServerFlags ServerFlags `json:"server_flags"` // ID of server channel ChannelID ULID `json:"channel_id"` // Name of server channel ChannelName string `json:"channel_name"` // Description of server channel ChannelDescription string `json:"channel_description"` // Name of user who created the invite UserName string `json:"user_name"` UserAvatar *AutumnFile `json:"user_avatar"` // Number of members in this server MemberCount int `json:"member_count"` }
type InviteType ¶
type InviteType string
const ( InviteTypeServer InviteType = "Server" InviteTypeGroup InviteType = "Group" )
type JSONArshaler ¶
type JSONArshaler interface { // if you want use default arshal, do `nil, ArshalNotImplemented{}` Marshal(any) ([]byte, error) Unmarshal([]byte, any) error }
func NewJSONArshaler ¶
func NewJSONArshaler(marshal Marshal, unmarshal Unmarshal) JSONArshaler
both params can be nil
type JoinInviteResponse ¶
type LatencyHistogramEntry ¶
type LatencyStats ¶
type LatencyStats struct { // Total operations Ops int64 `json:"ops"` // Timestamp at which data keeping begun Latency int64 `json:"latency"` // Histogram representation of latency data Histogram []*LatencyHistogramEntry `json:"histogram"` }
type LeaveServer ¶
type LeaveServer struct { // Whether to not send a leave message LeaveSilently *bool }
func (*LeaveServer) SetLeaveSilently ¶
func (ls *LeaveServer) SetLeaveSilently(b bool) *LeaveServer
func (*LeaveServer) UnsetLeaveSilently ¶
func (ls *LeaveServer) UnsetLeaveSilently() *LeaveServer
type Lockout ¶
type Lockout struct { // Attempt counter Attempts int `json:"attempts"` // Time at which this lockout expires Expiry *Time `json:"expiry"` }
Lockout information
type Login ¶
type Login 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 *MFAResponse `json:"mfa_response,omitempty"` // Friendly name used for the session FriendlyName string `json:"friendly_name,omitempty"` }
type LoginResponse ¶
type LoginResponse struct { Result LoginResponseType `json:"result"` // Unique ID ID ULID `json:"_id"` // User ID UserID ULID `json:"user_id"` Ticket string `json:"ticket"` // Session token Token string `json:"token"` // Display name Name string `json:"name"` Subscription *WebPushSubscription `json:"subscription"` AllowedMethods []string `json:"allowed_methods"` }
type LoginResponseType ¶
type LoginResponseType string
const ( LoginResponseTypeSuccess LoginResponseType = "Success" LoginResponseTypeMFA LoginResponseType = "MFA" LoginResponseTypeDisabled LoginResponseType = "Disabled" )
type MFAResponse ¶
type MFATicket ¶
type MFATicket struct { // Unique ID ID ULID `json:"_id"` // Account ID AccountID ULID `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"` }
type Masquerade ¶
type Masquerade 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 override information
type Member ¶
type Member struct { // Unique member ID ID MemberID `json:"_id"` // Time at which this user joined the server JoinedAt Time `json:"joined_at"` // Member's nickname Nickname string `json:"nickname,omitempty"` // Avatar attachment Avatar *AutumnFile `json:"avatar,omitempty"` // Member's roles Roles []ULID `json:"roles,omitempty"` // Timestamp this member is timed out until Timeout *Time `json:"timeout,omitempty"` }
type Message ¶
type Message struct { // Unique ID ID ULID `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 ULID `json:"channel"` // ID of the user or webhook that sent this message Author ULID `json:"author"` // The webhook that sent this message Webhook *MessageWebhook `json:"webhook,omitempty"` // Message content Content string `json:"content,omitempty"` System *SystemEventMessage `json:"system,omitempty"` // Array of attachments Attachments []*AutumnFile `json:"attachments,omitempty"` // Time at which this message was last edited Edited *Time `json:"edited"` // Attached embeds to this message Embeds []*Embed `json:"embeds,omitempty"` // Array of user IDs mentioned in this message Mentions []ULID `json:"mentions,omitempty"` // Array of message IDs this message is replying to Replies []ULID `json:"replies,omitempty"` // Hashmap of emoji IDs to array of user IDs Reactions map[string][]ULID `json:"reactions,omitempty"` Interactions *MessageInteractions `json:"interactions,omitempty"` Masquerade *Masquerade `json:"masquerade,omitempty"` }
func (*Message) ToOptimized ¶
func (o *Message) ToOptimized() *OptimizedMessage
type MessageAppend ¶
type MessageAppend struct { MessageID ULID `json:"id"` Channel ULID `json:"channel"` // will contain only `embeds` Append *PartialMessage `json:"append"` }
Message has data being appended to it.
type MessageDelete ¶
Message has been deleted.
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 MessageReact ¶
type MessageReact struct { MessageID ULID `json:"id"` ChannelID ULID `json:"channel_id"` UserID ULID `json:"user_id"` Emoji Emoji `json:"emoji_id"` }
A reaction has been added to a message.
type MessageRemoveReaction ¶
type MessageRemoveReaction struct { ID ULID `json:"id"` ChannelID ULID `json:"channel_id"` Emoji Emoji `json:"emoji_id"` }
A certain reaction has been removed from the message.
type MessageSort ¶
type MessageSort int
const ( MessageSortByNone MessageSort = iota MessageSortByRelevance MessageSortByLatest MessageSortByOldest )
func (MessageSort) MarshalJSON ¶
func (v MessageSort) MarshalJSON() ([]byte, error)
func (MessageSort) String ¶
func (v MessageSort) String() string
type MessageUnreact ¶
type MessageUnreact struct { MessageID ULID `json:"id"` ChannelID ULID `json:"channel_id"` UserID ULID `json:"user_id"` Emoji Emoji `json:"emoji_id"` }
A reaction has been removed from a message.
type MessageUpdate ¶
type MessageUpdate struct { MessageID ULID `json:"id"` Channel ULID `json:"channel"` Data *PartialMessage `json:"data"` }
Message edited or otherwise updated.
type MessageWebhook ¶
type MultiFactorAuthentication ¶
type MultiFactorAuthentication struct { // TOTP MFA token, enabled if present // (2-Factor) TOTPToken *TOTP `json:"totp_token,omitempty"` // Recovery codes RecoveryCodes []string `json:"recovery_codes,omitempty"` }
MFA configuration
type Node ¶
type Node struct { // Revolt API Version Revolt string `json:"revolt"` // Features enabled on this Revolt node Features FeatureConfiguration `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 BuildInformation `json:"build"` }
type OptimizedAutumnFile ¶
type OptimizedAutumnFileFlags ¶
type OptimizedAutumnFileFlags int
const ( OptimizedAutumnFileFlagsDeleted OptimizedAutumnFileFlags = 1 << (0 + iota) OptimizedAutumnFileFlagsIsDeletedNil OptimizedAutumnFileFlagsReported OptimizedAutumnFileFlagsIsReportedNil )
type OptimizedAutumnFileMetadata ¶
type OptimizedAutumnFileMetadata struct { Type OptimizedAutumnFileMetadataType Width int Height int }
type OptimizedAutumnFileMetadataType ¶
type OptimizedAutumnFileMetadataType int
const ( OptimizedAutumnFileMetadataTypeUnknown OptimizedAutumnFileMetadataType = iota OptimizedAutumnFileMetadataTypeFile OptimizedAutumnFileMetadataTypeText OptimizedAutumnFileMetadataTypeImage OptimizedAutumnFileMetadataTypeVideo OptimizedAutumnFileMetadataTypeAudio )
type OptimizedChannel ¶
type OptimizedChannel struct { Type OptimizedChannelType // Unique ID ID ULID // ID of the server this channel belongs to Server ULID // Display name of the channel Name string Flags OptimizedChannelFlags // User ID of the owner of the group Owner ULID // Channel description Description string Icon *OptimizedAutumnFile // 2-tuple of user ids participating in direct message / Array of user ids participating in channel Recipients []ULID // ID of the last message sent in this channel LastMessageID ULID // Permissions assigned to members of this group (does not apply to the owner of the group) Permissions Permissions // Representation of a single permission override as it appears on models and in the database DefaultPermissions *PermissionOverride // Permissions assigned based on role to this channel RolePermissions map[ULID]PermissionOverride // ID of the user this channel belongs to User ULID }
Same as Channel, but with flags bitfield instead of bools
func (OptimizedChannel) GetKey ¶
func (c OptimizedChannel) GetKey() ULID
type OptimizedChannelFlags ¶
type OptimizedChannelFlags int
const ( OptimizedChannelFlagActive OptimizedChannelFlags = 1 << (0 + iota) OptimizedChannelFlagNSFW )
type OptimizedChannelType ¶
type OptimizedChannelType int
const ( OptimizedChannelTypeUnknown OptimizedChannelType = iota OptimizedChannelTypeSavedMessages OptimizedChannelTypeDirectMessage OptimizedChannelTypeGroup OptimizedChannelTypeTextChannel OptimizedChannelTypeVoiceChannel )
type OptimizedCustomEmoji ¶
type OptimizedCustomEmoji struct { ID ULID Parent *OptimizedCustomEmojiParent CreatorID ULID Name string Flags OptimizedCustomEmojiFlags }
func (OptimizedCustomEmoji) GetKey ¶
func (e OptimizedCustomEmoji) GetKey() ULID
type OptimizedCustomEmojiFlags ¶
type OptimizedCustomEmojiFlags int
const ( OptimizedCustomEmojiFlagsAnimated OptimizedCustomEmojiFlags = 1 << (0 + iota) OptimizedCustomEmojiFlagsNSFW )
type OptimizedCustomEmojiParent ¶
type OptimizedCustomEmojiParent struct { Type OptimizedCustomEmojiParentType ID ULID }
type OptimizedCustomEmojiParentType ¶
type OptimizedCustomEmojiParentType int
const ( OptimizedCustomEmojiParentTypeUnknown OptimizedCustomEmojiParentType = iota OptimizedCustomEmojiParentTypeServer OptimizedCustomEmojiParentTypeDetached )
type OptimizedEmbed ¶
type OptimizedEmbed struct { Type OptimizedEmbedType URL string OriginalURL string Special *OptimizedEmbedSpecial Title string Description string Image *OptimizedEmbedImage Video *EmbedVideo SiteName string IconURL string Media *OptimizedAutumnFile Colour string Width int Height int Size OptimizedEmbedImageSize }
type OptimizedEmbedImage ¶
type OptimizedEmbedImage struct { URL string Width int Height int Size OptimizedEmbedImageSize }
type OptimizedEmbedImageSize ¶
type OptimizedEmbedImageSize int
const ( OptimizedEmbedImageSizeUnknown OptimizedEmbedImageSize = iota OptimizedEmbedImageSizeLarge OptimizedEmbedImageSizePreview )
type OptimizedEmbedSpecial ¶
type OptimizedEmbedSpecial struct { Type OptimizedEmbedSpecialType ID string ContentType string Timestamp string }
type OptimizedEmbedSpecialType ¶
type OptimizedEmbedSpecialType int
const ( OptimizedEmbedSpecialTypeUnknown OptimizedEmbedSpecialType = iota OptimizedEmbedSpecialTypeNone OptimizedEmbedSpecialTypeGIF OptimizedEmbedSpecialTypeYouTube OptimizedEmbedSpecialTypeLightspeed OptimizedEmbedSpecialTypeTwitch OptimizedEmbedSpecialTypeSpotify OptimizedEmbedSpecialTypeSoundcloud OptimizedEmbedSpecialTypeBandcamp OptimizedEmbedSpecialTypeStreamable )
type OptimizedEmbedType ¶
type OptimizedEmbedType int
const ( OptimizedEmbedTypeUnknown OptimizedEmbedType = iota OptimizedEmbedTypeWebsite OptimizedEmbedTypeImage OptimizedEmbedTypeVideo OptimizedEmbedTypeText OptimizedEmbedTypeNone )
type OptimizedMessage ¶
type OptimizedMessage struct { ID ULID Nonce *string Channel ULID Author ULID Webhook *MessageWebhook Content string System *OptimizedSystemEventMessage Attachments []*OptimizedAutumnFile Edited *Time Embeds []*OptimizedEmbed Mentions []ULID Replies []ULID Reactions map[string][]ULID Interactions *MessageInteractions Masquerade *Masquerade }
func (OptimizedMessage) GetKey ¶
func (o OptimizedMessage) GetKey() ULID
type OptimizedPresence ¶
type OptimizedPresence int
const ( OptimizedPresenceUnknown OptimizedPresence = iota OptimizedPresenceOnline OptimizedPresenceIdle OptimizedPresenceFocus OptimizedPresenceBusy OptimizedPresenceInvisible )
type OptimizedRelationshipStatus ¶
type OptimizedRelationshipStatus int
const ( OptimizedRelationshipStatusUnknown OptimizedRelationshipStatus = iota OptimizedRelationshipStatusNone OptimizedRelationshipStatusUser OptimizedRelationshipStatusFriend OptimizedRelationshipStatusOutgoing OptimizedRelationshipStatusIncoming OptimizedRelationshipStatusBlocked OptimizedRelationshipStatusBlockedOther )
type OptimizedRole ¶
type OptimizedRole struct { // Unique ID ID ULID // Role name Name string // Representation of a single permission override as it appears on models and in the database Permissions PermissionOverride // Colour used for this role // This can be any valid CSS colour Colour string Flags OptimizedRoleFlags // Default: `0` // Ranking of this role Rank int }
func (OptimizedRole) GetKey ¶
func (o OptimizedRole) GetKey() ULID
type OptimizedRoleFlags ¶
type OptimizedRoleFlags int
const (
OptimizedRoleFlagsHoist OptimizedRoleFlags = 1 << (0 + iota)
)
type OptimizedServer ¶
type OptimizedServer struct { // Unique ID ID ULID // User ID of the owner Owner ULID // Name of the server Name string // Description for the server Description string // Channels within this server Channels []ULID // Categories for this server Categories []*Category // System message channel assignments SystemMessages *SystemMessages // Default set of server and channel permissions DefaultPermissions Permissions Icon *OptimizedAutumnFile Banner *OptimizedAutumnFile // Bitfield of server flags Flags OptimizedServerFlags }
func (OptimizedServer) GetKey ¶
func (o OptimizedServer) GetKey() ULID
type OptimizedServerFlags ¶
type OptimizedServerFlags int
const ( OptimizedServerFlagsVerified OptimizedServerFlags = 1 << (0 + iota) OptimizedServerFlagsOfficial OptimizedServerFlagsNSFW OptimizedServerFlagsAnalytics OptimizedServerFlagsDiscoverable )
type OptimizedSystemEventMessageType ¶
type OptimizedSystemEventMessageType int
const ( OptimizedSystemEventMessageTypeUnknown OptimizedSystemEventMessageType = iota OptimizedSystemEventMessageTypeText OptimizedSystemEventMessageTypeUserAdded OptimizedSystemEventMessageTypeUserRemove OptimizedSystemEventMessageTypeUserJoined OptimizedSystemEventMessageTypeUserLeft OptimizedSystemEventMessageTypeUserKicked OptimizedSystemEventMessageTypeUserBanned OptimizedSystemEventMessageTypeChannelRenamed OptimizedSystemEventMessageTypeChannelDescriptionChanged OptimizedSystemEventMessageTypeChannelIconChanged OptimizedSystemEventMessageTypeChannelOwnershipChanged )
type OptimizedUser ¶
type OptimizedUser struct { ID ULID Username string Discriminator string DisplayName string Avatar *OptimizedAutumnFile Relations []*UserRelation Status *OptimizedUserStatus Profile *OptimizedUserProfile Bot *UserBot Relationship OptimizedRelationshipStatus Flags OptimizedUserFlags }
func (OptimizedUser) GetKey ¶
func (o OptimizedUser) GetKey() ULID
type OptimizedUserFlags ¶
type OptimizedUserFlags int
const ( OptimizedUserFlagsSuspended OptimizedUserFlags = 1 << (0 + iota) OptimizedUserFlagsDeleted OptimizedUserFlagsBanned OptimizedUserFlagsSpam OptimizedUserFlagsPrivileged OptimizedUserFlagsOnline OptimizedUserFlagsDeveloper OptimizedUserFlagsTranslator OptimizedUserFlagsSupporter OptimizedUserFlagsResponsibleDisclosure OptimizedUserFlagsFounder OptimizedUserFlagsPlatformModeration OptimizedUserFlagsActiveSupporter OptimizedUserFlagsPaw OptimizedUserFlagsEarlyAdopter OptimizedUserFlagsRelevantJokeBadge1 OptimizedUserFlagsRelevantJokeBadge2 )
func NewOptimizedUserFlags ¶
func NewOptimizedUserFlags(flags UserFlags, badges UserBadges, privileged, online bool) OptimizedUserFlags
type OptimizedUserProfile ¶
type OptimizedUserProfile struct { Content string Background *OptimizedAutumnFile }
type OptimizedUserStatus ¶
type OptimizedUserStatus struct { Text string Presence OptimizedPresence }
type OptimizedWebhook ¶
type OptimizedWebhook struct { // Webhook ID ID ULID `json:"id"` // The name of the webhook Name string `json:"name"` Avatar *OptimizedAutumnFile `json:"avatar"` // The channel this webhook belongs to ChannelID ULID `json:"channel_id"` // The permissions for the webhook Permissions Permissions `json:"permissions"` // The private token for the webhook Token string `json:"token"` }
func (OptimizedWebhook) GetKey ¶
func (o OptimizedWebhook) GetKey() ULID
type PartialChannel ¶
type PartialChannel struct { Type ChannelType `json:"channel_type"` // Unique ID ID ULID `json:"_id"` // ID of the server this channel belongs to Server ULID `json:"server"` // Display name of the channel Name string `json:"name"` // Whether this direct message channel is currently open on both sides Active *bool `json:"active"` // User ID of the owner of the group Owner ULID `json:"owner"` // Channel description Description *string `json:"description"` Icon *AutumnFile `json:"icon"` // 2-tuple of user ids participating in direct message / Array of user ids participating in channel Recipients []ULID `json:"recipients"` // ID of the last message sent in this channel LastMessageID ULID `json:"last_message_id"` // Permissions assigned to members of this group (does not apply to the owner of the group) Permissions *Permissions `json:"permissions"` // Representation of a single permission override as it appears on models and in the database DefaultPermissions *PermissionOverride `json:"default_permissions"` // Permissions assigned based on role to this channel RolePermissions *map[ULID]PermissionOverride `json:"role_permissions"` // ID of the user this channel belongs to User *ULID `json:"user"` // Whether this group is marked as not safe for work NSFW *bool `json:"nsfw"` }
type PartialMember ¶
type PartialMember struct { ID MemberID `json:"_id"` // Member's nickname Nickname *string `json:"nickname,omitempty"` Avatar *AutumnFile `json:"avatar,omitempty"` // Member's roles Roles *[]ULID `json:"roles,omitempty"` // ISO8601 formatted timestamp Timeout *Time `json:"timeout,omitempty"` }
type PartialMessage ¶
type PartialRole ¶
type PartialRole struct { // Role name Name string `json:"name,omitempty"` // Representation of a single permission override as it appears on models and in the database Permissions *PermissionOverride `json:"permissions,omitempty"` // 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"` // Default: `0` // Ranking of this role Rank *int `json:"rank,omitempty"` }
type PartialServer ¶
type PartialServer struct { // Unique ID ID ULID `json:"_id"` // User ID of the owner Owner string `json:"owner,omitempty"` // Name of the server Name *string `json:"name,omitempty"` // Description for the server Description *string `json:"description,omitempty"` // Channels within this server Channels *[]ULID `json:"channels,omitempty"` // Categories for this server Categories *[]*Category `json:"categories,omitempty"` // System message channel assignments SystemMessages *SystemMessages `json:"system_messages,omitempty"` // Roles for this server Roles *map[ULID]*Role `json:"roles,omitempty"` // Default set of server and channel permissions DefaultPermissions *Permissions `json:"default_permissions,omitempty"` Icon *AutumnFile `json:"icon,omitempty"` Banner *AutumnFile `json:"banner,omitempty"` // Bitfield of server flags Flags *ServerFlags `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"` }
type PartialUser ¶
type PartialUser struct { // Unique ID ID ULID `json:"_id"` // Username Username *string `json:"username"` // Discriminator Discriminator *string `json:"discriminator"` // Display name DisplayName *string `json:"display_name"` Avatar *AutumnFile `json:"avatar"` // Relationships with other users Relations *[]*UserRelation `json:"relations"` // Bitfield of user badges Badges *UserBadges `json:"badges"` // User's active status Status *UserStatus `json:"status"` // User's profile Profile *UserProfile `json:"profile"` // Enum of user flags Flags *UserFlags `json:"flags"` // Bot information for if the user is a bot Bot *UserBot `json:"bot"` // User's relationship with another user (or themselves) Relationship *RelationshipStatus `json:"relationship"` // Whether this user is currently online Online *bool `json:"online"` }
type PartialWebhook ¶
type PartialWebhook struct { // Webhook ID ID ULID `json:"id"` // The name of the webhook Name string `json:"name,omitempty"` Avatar *AutumnFile `json:"avatar,omitempty"` // The permissions for the webhook Permissions *Permissions `json:"permissions,omitempty"` }
type PasswordReset ¶
type PasswordReset struct { // Token required to change password Token string `json:"token"` // Time at which this token expires Expiry *Time `json:"expiry,omitempty"` }
Password reset information
type PermissionOverride ¶
type PermissionOverride struct { // Allow bit flags Allow Permissions `json:"a"` // Disallow bit flags Disallow Permissions `json:"d"` }
type Permissions ¶
type Permissions int64
const ( PermissionManageChannel Permissions = 1 << iota PermissionManageServer PermissionManagePermissions PermissionManageRoles PermissionManageCustomisation PermissionKickMembers Permissions = 1 << (6 + iota) PermissionBanMembers PermissionTimeoutMembers PermissionAssignRoles PermissionChangeNickname PermissionManageNicknames PermissionChangeAvatar PermissionRemoveAvatars PermissionViewChannel Permissions = 1 << (20 + iota) PermissionReadMessageHistory PermissionSendMessages PermissionManageMessages PermissionManageWebhooks PermissionInviteOthers PermissionSendEmbeds PermissionUploadFiles PermissionMasquerade PermissionReact PermissionConnect PermissionSpeak PermissionVideo PermissionMuteMembers PermissionDeafenMembers PermissionMoveMembers )
type Presence ¶
type Presence string
const ( // User is online PresenceOnline Presence = "Online" // User is not currently available PresenceIdle Presence = "Idle" // User is focusing / will only receive mentions PresenceFocus Presence = "Focus" // User is busy / will not receive any notifications PresenceBusy Presence = "Busy" // User appears to be offline PresenceInvisible Presence = "Invisible" )
func (Presence) ToOptimized ¶
func (o Presence) ToOptimized() OptimizedPresence
type QueryExecStats ¶
type QueryExecStats struct { // Query collection scan stats CollectionScans CollectionScans `json:"collectionScans"` }
type Ready ¶
type Ready struct { Users []*User `json:"users"` Servers []*Server `json:"servers"` Channels []*Channel `json:"channels"` Members []*Member `json:"members"` Emojis *[]CustomEmoji `json:"emojis"` }
Data for use by client, data structures match the API specification.
type RelationshipStatus ¶
type RelationshipStatus string
User's relationship with another user (or themselves)
const ( RelationshipStatusNone RelationshipStatus = "None" RelationshipStatusUser RelationshipStatus = "User" RelationshipStatusFriend RelationshipStatus = "Friend" RelationshipStatusOutgoing RelationshipStatus = "Outgoing" RelationshipStatusIncoming RelationshipStatus = "Incoming" RelationshipStatusBlocked RelationshipStatus = "Blocked" RelationshipStatusBlockedOther RelationshipStatus = "BlockedOther" )
func (RelationshipStatus) ToOptimized ¶
func (s RelationshipStatus) ToOptimized() OptimizedRelationshipStatus
type Report ¶
type Report struct { Status ReportStatus `json:"status"` RejectionReason string `json:"rejection_reason,omitempty"` ClosedAt *Time `json:"closed_at,omitempty"` // Unique ID ID ULID `json:"_id"` // ID of the user creating this report AuthorID ULID `json:"author_id"` // The content being reported Content ReportContent `json:"content"` // Additional report context AdditionalContext string `json:"additional_context"` // Additional notes included on the report Notes string `json:"notes"` }
type ReportContent ¶
type ReportContent struct { Type ReportContentType `json:"type"` // ID of the message / ID of the server / ID of the user ID ULID `json:"id"` // Reason for reporting content (message or server) ReportReason ReportReason `json:"report_reason"` // Message context MessageID ULID `json:"message_id,omitempty"` }
type ReportContentType ¶
type ReportContentType string
const ( ReportContentTypeMessage ReportContentType = "Message" ReportContentTypeServer ReportContentType = "Server" ReportContentTypeUser ReportContentType = "User" )
type ReportReason ¶
type ReportReason string
const ( // No reason has been specified ReportReasonNoneSpecified ReportReason = "NoneSpecified" // Illegal content catch-all reason ReportReasonIllegal ReportReason = "Illegal" // Message/Server // Selling or facilitating use of drugs or other illegal goods ReportReasonIllegalGoods ReportReason = "IllegalGoods" // Message/Server // Extortion or blackmail ReportReasonIllegalExtortion ReportReason = "IllegalExtortion" // Message/Server // Revenge or child pornography ReportReasonIllegalPornography ReportReason = "IllegalPornography" // Message/Server // Illegal hacking activity ReportReasonIllegalHacking ReportReason = "IllegalHacking" // Message/Server // Extreme violence, gore, or animal cruelty // With exception to violence potrayed in media / creative arts ReportReasonExtremeViolence ReportReason = "ExtremeViolence" // Message/Server // Content that promotes harm to others / self ReportReasonProtesHarm ReportReason = "ProtesHarm" // Message/Server // Unsolicited advertisements ReportReasonUnsolicitedSpam ReportReason = "UnsolicitedSpam" // Message/Server/User // This is a raid ReportReasonRaid ReportReason = "Raid" // Message/Server // Spam or platform abuse / User is sending spam or otherwise abusing the platform ReportReasonSpamAbuse ReportReason = "SpamAbuse" // Message/Server/User // Scams or fraud ReportReasonScamsFraud ReportReason = "ScamsFraud" // Message/Server // Distribution of malware of malicious links ReportReasonMalware ReportReason = "Malware" // Message/Server // Harassment or abuse targeted at another user ReportReasonHarassment ReportReason = "Harassment" // Message/Server // User's profile contains inappropriate content for a general audience ReportReasonInappropriateProfile ReportReason = "InappropriateProfile" // User // User is impersonating another user ReportReasonImpersonation ReportReason = "Impersonation" // User // User is evading a ban ReportReasonBanEvasion ReportReason = "BanEvasion" // User // User is not of minimum age to use the platform ReportReasonUnderage ReportReason = "Underage" // User )
type ReportStatus ¶
type ReportStatus string
const ( ReportStatusCreated ReportStatus = "Created" ReportStatusRejected ReportStatus = "Rejected" ReportStatusResolved ReportStatus = "Resolved" )
type RequestOptions ¶
type Role ¶
type Role struct { // Role name Name string `json:"name"` // Representation of a single permission override as it appears on models and in the database Permissions PermissionOverride `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"` // Default: `0` // Ranking of this role Rank int `json:"rank"` }
func (*Role) ToOptimized ¶
func (r *Role) ToOptimized(id ULID) *OptimizedRole
type RoleResponse ¶
type SearchForMessages ¶
type SearchForMessages struct { // Full-text search query // See [MongoDB documentation](https://docs.mongodb.com/manual/text-search/#-text-operator) for more information. Query string // Maximum number of messages to fetch Limit int // Message id before which messages should be fetched Before ULID // Message id after which messages should be fetched After ULID // Sort used for retrieving messages Sort MessageSort // Whether to include user (and member, if server channel) objects IncludeUsers *bool }
type SendMessage ¶
type SendMessage struct { // Unique token to prevent duplicate message sending IdempotencyKey string `json:"-"` // 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"` // Name and / or avatar override information Masquerade *Masquerade `json:"masquerade,omitempty"` // Information to guide interactions on this message Interactions *MessageInteractions `json:"interactions,omitempty"` }
func (*SendMessage) AddAttachments ¶
func (sm *SendMessage) AddAttachments(attachments ...string) *SendMessage
func (*SendMessage) AddEmbeds ¶
func (sm *SendMessage) AddEmbeds(embeds ...SendableEmbed) *SendMessage
func (*SendMessage) AddReply ¶
func (sm *SendMessage) AddReply(replies ...Reply) *SendMessage
func (*SendMessage) ReplyTo ¶
func (sm *SendMessage) ReplyTo(messages ...ULID) *SendMessage
func (*SendMessage) SetAttachments ¶
func (sm *SendMessage) SetAttachments(attachments []string) *SendMessage
func (*SendMessage) SetContent ¶
func (sm *SendMessage) SetContent(content string) *SendMessage
func (*SendMessage) SetEmbeds ¶
func (sm *SendMessage) SetEmbeds(embeds []SendableEmbed) *SendMessage
func (*SendMessage) SetInteractions ¶
func (sm *SendMessage) SetInteractions(interactions *MessageInteractions) *SendMessage
func (*SendMessage) SetMasquerade ¶
func (sm *SendMessage) SetMasquerade(masquerade *Masquerade) *SendMessage
func (*SendMessage) SetReplies ¶
func (sm *SendMessage) SetReplies(replies []Reply) *SendMessage
type SendableEmbed ¶
type SendableEmbed struct { IconURL string `json:"icon_url,omitempty"` // URL in embed title URL string `json:"url,omitempty"` // Embed title Title string `json:"title,omitempty"` // Embed description Description string `json:"description,omitempty"` // Embed media Media string `json:"media,omitempty"` // Embed colour. This can be any valid CSS colour. Colour string `json:"colour,omitempty"` }
type Server ¶
type Server struct { // Unique ID ID ULID `json:"_id"` // User ID of the owner Owner ULID `json:"owner"` // Name of the server Name string `json:"name"` // Description for the server Description string `json:"description,omitempty"` // Channels within this server Channels []ULID `json:"channels"` // Categories for this server Categories []*Category `json:"categories,omitempty"` // System message channel assignments SystemMessages *SystemMessages `json:"system_messages,omitempty"` // Roles for this server Roles map[ULID]*Role `json:"roles,omitempty"` // Default set of server and channel permissions DefaultPermissions Permissions `json:"default_permissions"` Icon *AutumnFile `json:"icon,omitempty"` Banner *AutumnFile `json:"banner,omitempty"` // Bitfield of server flags Flags ServerFlags `json:"flags"` // 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"` }
func (*Server) ToOptimized ¶
func (o *Server) ToOptimized() *OptimizedServer
type ServerCreate ¶
type ServerCreate struct { // Unique ID ID ULID `json:"id"` // Server Server *Server `json:"server"` // Channels within this server Channels []*Channel `json:"channels"` // Emojis within this server Emojis []*CustomEmoji `json:"emojis"` }
Server has been created.
type ServerFlags ¶
type ServerFlags int
const ( ServerFlagsVerified ServerFlags = 1 << (0 + iota) ServerFlagsOfficial )
func (ServerFlags) ToOptimized ¶
func (sf ServerFlags) ToOptimized() (r OptimizedServerFlags)
type ServerMemberJoin ¶
A user has joined the server.
type ServerMemberLeave ¶
A user has left the server.
type ServerMemberUpdate ¶
type ServerMemberUpdate struct { ID MemberID `json:"id"` Data *PartialMember `json:"data"` // Possible values: ["Nickname", "Avatar", "Roles", "Timeout"] Clear []string `json:"clear"` }
Server member details updated.
func (*ServerMemberUpdate) IsAvatarRemoved ¶
func (smu *ServerMemberUpdate) IsAvatarRemoved() bool
Whether avatar was removed.
func (*ServerMemberUpdate) IsNicknameRemoved ¶
func (smu *ServerMemberUpdate) IsNicknameRemoved() bool
Whether nickname was removed.
func (*ServerMemberUpdate) IsRolesWereCleared ¶
func (smu *ServerMemberUpdate) IsRolesWereCleared() bool
Whether roles were cleared.
func (*ServerMemberUpdate) IsTimeoutRemoved ¶
func (smu *ServerMemberUpdate) IsTimeoutRemoved() bool
Whether timeout was removed.
type ServerResponse ¶
type ServerRoleDelete ¶
Server role has been deleted.
type ServerRoleUpdate ¶
type ServerRoleUpdate struct { ServerID ULID `json:"id"` RoleID ULID `json:"role_id"` Data *PartialRole `json:"data"` // Possible values: ["Colour"] Clear []string `json:"clear"` IsCreated bool `json:"-"` }
Server role has been updated or created.
func (*ServerRoleUpdate) IsColourRemoved ¶
func (sru *ServerRoleUpdate) IsColourRemoved() bool
Whether colour was removed.
type ServerUpdate ¶
type ServerUpdate struct { ServerID ULID `json:"id"` Data *PartialServer `json:"data"` // Possible values: ["Description", "Categories", "SystemMessages", "Icon", "Banner"] Clear []string `json:"clear"` }
Server details updated.
func (*ServerUpdate) IsBannerRemoved ¶
func (su *ServerUpdate) IsBannerRemoved() bool
Whether banner was removed.
func (*ServerUpdate) IsCategoriesWereRemoved ¶
func (su *ServerUpdate) IsCategoriesWereRemoved() bool
Whether categories were removed.
func (*ServerUpdate) IsDescriptionCleared ¶
func (su *ServerUpdate) IsDescriptionCleared() bool
Whether description was cleared.
func (*ServerUpdate) IsIconRemoved ¶
func (su *ServerUpdate) IsIconRemoved() bool
Whether icon was removed.
func (*ServerUpdate) IsSystemMessagesWereRemoved ¶
func (su *ServerUpdate) IsSystemMessagesWereRemoved() bool
Whether system messages were removed.
type SetDefaultPermission ¶
type SetDefaultPermission struct { // Permission values to set for members in a `Group` Permission Permissions // Representation of a single permission override Permissions *PermissionOverride }
func (SetDefaultPermission) MarshalJSON ¶
func (p SetDefaultPermission) MarshalJSON() ([]byte, error)
type Setting ¶
func (*Setting) UnmarshalJSON ¶
type Snapshot ¶
type Snapshot struct { // Users involved in snapshot Users []*User `json:"_users,omitempty"` // Channels involved in snapshot Channels []*Channel `json:"_channels,omitempty"` // Server involved in snapshot Server *Server `json:"_server,omitempty"` // Unique ID ID ULID `json:"_id"` // Report parent ID ReportID ULID `json:"report_id,omitempty"` // Enum to map into different models that can be saved in a snapshot Content *SnapshotContent `json:"content"` }
type SnapshotContent ¶
type SnapshotContent struct { Type SnapshotContentType `json:"_type"` // [Message] Context before the message PriorContext []*Message `json:"_prior_context"` // [Message] Context after the message LeadingContext []*Message `json:"_leading_context"` // [Message,Server,User] Unique ID ID ULID `json:"_id"` // [Message] Unique value generated by client sending this message Nonce *string `json:"nonce"` // [Message] ID of the channel this message was sent in Channel ULID `json:"channel"` // [Message] ID of the user or webhook that sent this message Author ULID `json:"author"` // [Message] Information about the webhook bundled with Message Webhook *MessageWebhook `json:"webhook"` // [Message] Message content Content string `json:"content"` // [Message] System *SystemEventMessage `json:"system"` // [Message] Attachments []*AutumnFile `json:"attachments"` // [Message] Edited *Time `json:"edited"` // [Message] Attached embeds to this message Embeds []*Embed `json:"embeds"` // [Message] Array of user IDs mentioned in this message Mentions []ULID `json:"mentions"` // [Message] Array of message IDs this message is replyingto Replies []ULID `json:"replies"` // [Message] Hashmap of emoji IDs to array of user IDs Reactions map[string][]ULID `json:"reactions"` // [Message] Interactions *MessageInteractions `json:"interactions"` // [Message] Masquerade *Masquerade `json:"masquerade"` // [Server] User ID of the owner Owner ULID `json:"owner"` // [Server] Name of the server Name string `json:"name"` // [Server] Description for the server Description string `json:"description"` // [Server] Channels within this server Channels []ULID `json:"channels"` // [Server] Categories for this server Categories []*Category `json:"categories"` // [Server] System message channel assignments SystemMessages *SystemMessages `json:"system_messages"` // [Server] Roles for this server Roles map[ULID]*Role `json:"roles"` // [Server] Default set of server and channel permissions DefaultPermissions Permissions `json:"default_permissions"` // [Server] Icon *AutumnFile `json:"icon"` // [Server] Banner *AutumnFile `json:"banner"` // [Server,User] Bitfield of server flags / Enum of user flags Flags int `json:"flags"` // [Server] Whether this server is flagged as not safe for work NSFW bool `json:"nsfw"` // [Server] Whether to enable analytics Analytics bool `json:"analytics"` // [Server] Whether this server should be publicly discoverable Discoverable bool `json:"discoverable"` // [User] Username Username string `json:"username"` // [User] Discriminator Discriminator string `json:"discriminator"` // [User] Display name DisplayName string `json:"display_name"` // [User] Avatar *AutumnFile `json:"avatar"` // [User] Relationships with other users Relations []*UserRelation `json:"relations"` // [User] Bitfield of user badges Badges UserBadges `json:"badges"` // [User] User's active status Status *UserStatus `json:"status"` // [User] User's profile Profile *UserProfile `json:"profile"` // [User] Whether this user is privileged Privileged bool `json:"privileged"` // [User] Bot information for if the user is a bot Bot *UserBot `json:"bot"` // [User] User's relationship with another user (or themselves) Relationship RelationshipStatus `json:"relationship"` // [User] Whether this user is currently online Online bool `json:"online"` }
func (*SnapshotContent) ToMessage ¶
func (sc *SnapshotContent) ToMessage() *Message
func (*SnapshotContent) ToServer ¶
func (sc *SnapshotContent) ToServer() *Server
func (*SnapshotContent) ToUser ¶
func (sc *SnapshotContent) ToUser() *User
type SnapshotContentType ¶
type SnapshotContentType string
const ( SnapshotContentTypeMessage SnapshotContentType = "Message" SnapshotContentTypeServer SnapshotContentType = "Server" SnapshotContentTypeUser SnapshotContentType = "User" )
type Socket ¶
type Socket struct { Token string Dialer WebsocketDialer Connection *websocket.Conn URL *url.URL Me *User Events Events Cache *GenericCache Logger *slog.Logger Arshaler JSONArshaler // contains filtered or unexported fields }
func (*Socket) Authenticate ¶
func (*Socket) BeginTyping ¶
func (*Socket) CloseWithCode ¶
func (*Socket) OnAuthenticated ¶
func (socket *Socket) OnAuthenticated(f func(*Authenticated)) *Subscription[*Authenticated]
func (*Socket) OnBulkDeleteMessage ¶
func (socket *Socket) OnBulkDeleteMessage(f func(*BulkDeleteMessage)) *Subscription[*BulkDeleteMessage]
func (*Socket) OnChannelAck ¶
func (socket *Socket) OnChannelAck(f func(*ChannelAck)) *Subscription[*ChannelAck]
func (*Socket) OnChannelCreate ¶
func (socket *Socket) OnChannelCreate(f func(*Channel)) *Subscription[*Channel]
func (*Socket) OnChannelDelete ¶
func (socket *Socket) OnChannelDelete(f func(*ChannelDelete)) *Subscription[*ChannelDelete]
func (*Socket) OnChannelGroupJoin ¶
func (socket *Socket) OnChannelGroupJoin(f func(*ChannelGroupJoin)) *Subscription[*ChannelGroupJoin]
func (*Socket) OnChannelGroupLeave ¶
func (socket *Socket) OnChannelGroupLeave(f func(*ChannelGroupLeave)) *Subscription[*ChannelGroupLeave]
func (*Socket) OnChannelStartTyping ¶
func (socket *Socket) OnChannelStartTyping(f func(*ChannelStartTyping)) *Subscription[*ChannelStartTyping]
func (*Socket) OnChannelStopTyping ¶
func (socket *Socket) OnChannelStopTyping(f func(*ChannelStopTyping)) *Subscription[*ChannelStopTyping]
func (*Socket) OnChannelUpdate ¶
func (socket *Socket) OnChannelUpdate(f func(*ChannelUpdate)) *Subscription[*ChannelUpdate]
func (*Socket) OnEmojiCreate ¶
func (socket *Socket) OnEmojiCreate(f func(*CustomEmoji)) *Subscription[*CustomEmoji]
func (*Socket) OnEmojiDelete ¶
func (socket *Socket) OnEmojiDelete(f func(*EmojiDelete)) *Subscription[*EmojiDelete]
func (*Socket) OnMessage ¶
func (socket *Socket) OnMessage(f func(*Message)) *Subscription[*Message]
func (*Socket) OnMessageAppend ¶
func (socket *Socket) OnMessageAppend(f func(*MessageAppend)) *Subscription[*MessageAppend]
func (*Socket) OnMessageDelete ¶
func (socket *Socket) OnMessageDelete(f func(*MessageDelete)) *Subscription[*MessageDelete]
func (*Socket) OnMessageReact ¶
func (socket *Socket) OnMessageReact(f func(*MessageReact)) *Subscription[*MessageReact]
func (*Socket) OnMessageRemoveReaction ¶
func (socket *Socket) OnMessageRemoveReaction(f func(*MessageRemoveReaction)) *Subscription[*MessageRemoveReaction]
func (*Socket) OnMessageUnreact ¶
func (socket *Socket) OnMessageUnreact(f func(*MessageUnreact)) *Subscription[*MessageUnreact]
func (*Socket) OnMessageUpdate ¶
func (socket *Socket) OnMessageUpdate(f func(*MessageUpdate)) *Subscription[*MessageUpdate]
func (*Socket) OnReportCreate ¶
func (socket *Socket) OnReportCreate(f func(*Report)) *Subscription[*Report]
func (*Socket) OnRevoltError ¶
func (socket *Socket) OnRevoltError(f func(string)) *Subscription[string]
func (*Socket) OnServerCreate ¶
func (socket *Socket) OnServerCreate(f func(*ServerCreate)) *Subscription[*ServerCreate]
func (*Socket) OnServerDelete ¶
func (socket *Socket) OnServerDelete(f func(*ServerDelete)) *Subscription[*ServerDelete]
func (*Socket) OnServerMemberJoin ¶
func (socket *Socket) OnServerMemberJoin(f func(*ServerMemberJoin)) *Subscription[*ServerMemberJoin]
func (*Socket) OnServerMemberLeave ¶
func (socket *Socket) OnServerMemberLeave(f func(*ServerMemberLeave)) *Subscription[*ServerMemberLeave]
func (*Socket) OnServerMemberUpdate ¶
func (socket *Socket) OnServerMemberUpdate(f func(*ServerMemberUpdate)) *Subscription[*ServerMemberUpdate]
func (*Socket) OnServerRoleDelete ¶
func (socket *Socket) OnServerRoleDelete(f func(*ServerRoleDelete)) *Subscription[*ServerRoleDelete]
func (*Socket) OnServerRoleUpdate ¶
func (socket *Socket) OnServerRoleUpdate(f func(*ServerRoleUpdate)) *Subscription[*ServerRoleUpdate]
func (*Socket) OnServerUpdate ¶
func (socket *Socket) OnServerUpdate(f func(*ServerUpdate)) *Subscription[*ServerUpdate]
func (*Socket) OnUserPlatformWipe ¶
func (socket *Socket) OnUserPlatformWipe(f func(*UserPlatformWipe)) *Subscription[*UserPlatformWipe]
func (*Socket) OnUserRelationship ¶
func (socket *Socket) OnUserRelationship(f func(*UserRelationship)) *Subscription[*UserRelationship]
func (*Socket) OnUserSettingsUpdate ¶
func (socket *Socket) OnUserSettingsUpdate(f func(*UserSettingsUpdate)) *Subscription[*UserSettingsUpdate]
func (*Socket) OnUserUpdate ¶
func (socket *Socket) OnUserUpdate(f func(*UserUpdate)) *Subscription[*UserUpdate]
func (*Socket) OnWebhookCreate ¶
func (socket *Socket) OnWebhookCreate(f func(*Webhook)) *Subscription[*Webhook]
func (*Socket) OnWebhookDelete ¶
func (socket *Socket) OnWebhookDelete(f func(*WebhookDelete)) *Subscription[*WebhookDelete]
func (*Socket) OnWebhookUpdate ¶
func (socket *Socket) OnWebhookUpdate(f func(*WebhookUpdate)) *Subscription[*WebhookUpdate]
type SocketAccount ¶
type SocketAccount struct { // Unique ID ID string `json:"_id"` // User's email Email string `json:"email"` // Normalised email // // (see https://github.com/insertish/authifier/#how-does-authifier-work) EmailNormalised string `json:"email_normalised"` // Argon2 hashed password Password string `json:"password"` // Whether the account is disabled Disabled bool `json:"disabled"` // Email verification status Verification *EmailVerification `json:"verification"` // Password reset information PasswordReset *PasswordReset `json:"password_reset"` // Account deletion information Deletion *DeletionInfo `json:"deletion"` // Account lockout Lockout *Lockout `json:"lockout"` // Multi-factor authentication information MFA *MultiFactorAuthentication `json:"mfa"` }
Account model
type SocketConfig ¶
type SocketConfig struct { Cache *GenericCache Dialer WebsocketDialer URL *url.URL AddLogSource bool Logger *slog.Logger DisableLogging bool LoggerLevel slog.Leveler Arshaler JSONArshaler }
type SocketError ¶
type SocketError struct {
ErrorID string
}
func (SocketError) Error ¶
func (se SocketError) Error() string
type SocketSession ¶
type SocketSession struct { // Unique ID ID string `json:"_id"` // User ID UserID string `json:"user_id"` // Session token Token string `json:"token"` // Display name Name string `json:"name"` // Web Push subscription Subscription *WebPushSubscription `json:"subscription,omitempty"` }
type Subscription ¶
type Subscription[T any] struct { Controller *EventController[T] ID int }
func (*Subscription[T]) Delete ¶
func (s *Subscription[T]) Delete()
type SystemEventMessage ¶
type SystemEventMessage struct { Type SystemEventMessageType `json:"type"` Content string `json:"content,omitempty"` ID ULID `json:"id,omitempty"` Name string `json:"name,omitempty"` By ULID `json:"by,omitempty"` From ULID `json:"from,omitempty"` To ULID `json:"to,omitempty"` }
Representation of a system event message
func (*SystemEventMessage) ToOptimized ¶
func (o *SystemEventMessage) ToOptimized() *OptimizedSystemEventMessage
type SystemEventMessageType ¶
type SystemEventMessageType string
const ( SystemEventMessageTypeText SystemEventMessageType = "text" SystemEventMessageTypeUserAdded SystemEventMessageType = "user_added" SystemEventMessageTypeUserRemove SystemEventMessageType = "user_remove" SystemEventMessageTypeUserJoined SystemEventMessageType = "user_joined" SystemEventMessageTypeUserLeft SystemEventMessageType = "user_left" SystemEventMessageTypeUserKicked SystemEventMessageType = "user_kicked" SystemEventMessageTypeUserBanned SystemEventMessageType = "user_banned" SystemEventMessageTypeChannelRenamed SystemEventMessageType = "channel_renamed" SystemEventMessageTypeChannelDescriptionChanged SystemEventMessageType = "channel_description_changed" SystemEventMessageTypeChannelIconChanged SystemEventMessageType = "channel_icon_changed" SystemEventMessageTypeChannelOwnershipChanged SystemEventMessageType = "channel_ownership_changed" )
func (SystemEventMessageType) ToOptimized ¶
func (s SystemEventMessageType) ToOptimized() OptimizedSystemEventMessageType
type SystemMessages ¶
type SystemMessages struct { // ID of channel to send user join messages in UserJoined ULID `json:"user_joined,omitempty"` // ID of channel to send user left messages in UserLeft ULID `json:"user_left,omitempty"` // ID of channel to send user kicked messages in UserKicked ULID `json:"user_kicked,omitempty"` // ID of channel to send user banned messages in UserBanned ULID `json:"user_banned,omitempty"` }
type TOTP ¶
type TOTP struct { Status TOTPStatus `json:"status"` // [Present only on Pending/Enabled] Secret string `json:"secret,omitempty"` }
Time-based one-time password configuration
type TOTPStatus ¶
type TOTPStatus string
const ( // Disabled TOTPStatusDisabled TOTPStatus = "Disabled" // Waiting for user activation TOTPStatusPending TOTPStatus = "Pending" // Required on account TOTPStatusEnabled TOTPStatus = "Enabled" )
type Token ¶
func NewBotToken ¶
NewBotToken returns an Token with type "TokenTypeBot" set
func NewUserToken ¶
NewUserToken returns an Token with type "TokenTypeUser" set
type UnreadMessage ¶
type UnreadMessage struct { ID UnreadMessageID `json:"_id"` // ID of the last message read in this channel by a user LastID ULID `json:"last_id,omitempty"` // Array of message IDs that mention the user Mentions []ULID `json:"mentions,omitempty"` }
type UnreadMessageID ¶
type UnreadMessageID struct { // Channel ID Channel ULID `json:"channel"` // User ID User ULID `json:"user"` }
Composite primary key consisting of channel and user ID
type User ¶
type User struct { // Unique ID ID ULID `json:"_id"` // Username Username string `json:"username"` // Discriminator Discriminator string `json:"discriminator"` // Display name DisplayName string `json:"display_name,omitempty"` // Avatar attachment Avatar *AutumnFile `json:"avatar,omitempty"` // Relationships with other users Relations []*UserRelation `json:"relations,omitempty"` // Bitfield of user badges Badges UserBadges `json:"badges"` // User's active status Status *UserStatus `json:"status,omitempty"` // User's profile Profile *UserProfile `json:"profile,omitempty"` // Enum of user flags Flags UserFlags `json:"flags"` // Whether this user is privileged Privileged bool `json:"privileged,omitempty"` // Bot information Bot *UserBot `json:"bot,omitempty"` // User's relationship with another user (or themselves) Relationship RelationshipStatus `json:"relationship,omitempty"` // Whether this user is currently online Online bool `json:"online"` }
func (*User) ToOptimized ¶
func (u *User) ToOptimized() *OptimizedUser
type UserBadges ¶
type UserBadges int
User badge bitfield
const ( // Active or significant contributor to Revolt UserBadgesDeveloper UserBadges = 1 << (0 + iota) // Helped translate Revolt UserBadgesTranslator // Monetarily supported Revolt UserBadgesSupporter // Responsibly disclosed a security issue UserBadgesResponsibleDisclosure // Revolt Founder UserBadgesFounder // Platform moderator UserBadgesPlatformModeration // Active monetary supporter UserBadgesActiveSupporter // 🦊🦝 UserBadgesPaw // Joined as one of the first 1000 users in 2021 UserBadgesEarlyAdopter // Amogus UserBadgesRelevantJokeBadge1 // Low resolution troll face UserBadgesRelevantJokeBadge2 )
type UserBot ¶
type UserBot struct { // ID of the owner of this bot Owner ULID `json:"owner"` }
Bot information for if the user is a bot
type UserPlatformWipe ¶
User has been platform banned or deleted their account. Clients should remove the following associated data: - Messages - DM Channels - Relationships - Server Memberships User flags are specified to explain why a wipe is occurring though not all reasons will necessarily ever appear.
type UserProfile ¶
type UserProfile struct { // Text content on user's profile Content string `json:"content,omitempty"` Background *AutumnFile `json:"background,omitempty"` }
func (*UserProfile) ToOptimized ¶
func (o *UserProfile) ToOptimized() *OptimizedUserProfile
type UserRelation ¶
type UserRelation struct { UserID ULID `json:"_id"` // User's relationship with another user (or themselves) Status RelationshipStatus `json:"status"` }
type UserRelationship ¶
Your relationship with another user has changed.
func (*UserRelationship) Status ¶
func (ur *UserRelationship) Status() RelationshipStatus
type UserSettingsUpdate ¶
Settings were updated remotely
type UserStatus ¶
type UserStatus struct { // Custom status text Text string `json:"text,omitempty"` // Presence status Presence Presence `json:"presence,omitempty"` }
User's active status
func (*UserStatus) ToOptimized ¶
func (o *UserStatus) ToOptimized() *OptimizedUserStatus
type UserUpdate ¶
type UserUpdate struct { UserID ULID `json:"id"` Data *PartialUser `json:"data"` // Possible values: ["Avatar", "StatusText", "StatusPresence", "ProfileContent", "ProfileBackground", "DisplayName"] Clear []string `json:"clear"` EventID ULID `json:"event_id"` }
User has been updated.
func (*UserUpdate) IsAvatarRemoved ¶
func (uu *UserUpdate) IsAvatarRemoved() bool
Whether avatar was removed.
func (*UserUpdate) IsDisplayNameRemoved ¶
func (uu *UserUpdate) IsDisplayNameRemoved() bool
Whether display name was removed.
func (*UserUpdate) IsProfileBackgroundRemoved ¶
func (uu *UserUpdate) IsProfileBackgroundRemoved() bool
Whether profile background was removed.
func (*UserUpdate) IsProfileContentRemoved ¶
func (uu *UserUpdate) IsProfileContentRemoved() bool
Whether profile content was removed.
func (*UserUpdate) IsStatusPresenceRemoved ¶
func (uu *UserUpdate) IsStatusPresenceRemoved() bool
Whether status presence was removed.
func (*UserUpdate) IsStatusTextRemoved ¶
func (uu *UserUpdate) IsStatusTextRemoved() bool
Whether status text was removed.
type WebPushSubscription ¶
type Webhook ¶
type Webhook struct { // Webhook ID ID ULID `json:"id"` // The name of the webhook Name string `json:"name"` // The avatar of the webhook Avatar *AutumnFile `json:"avatar,omitempty"` // The channel this webhook belongs to ChannelID ULID `json:"channel_id"` // The permissions for the webhook Permissions Permissions `json:"permissions"` // The private token for the webhook Token string `json:"token,omitempty"` }
func (*Webhook) ToOptimized ¶
func (w *Webhook) ToOptimized() *OptimizedWebhook
type WebhookUpdate ¶
type WebhookUpdate struct { ID ULID `json:"id"` Data *PartialWebhook `json:"data"` // Possible values: ["Avatar"] Remove []string `json:"remove"` }
Webhook details updated.
func (*WebhookUpdate) IsAvatarRemoved ¶
func (wu *WebhookUpdate) IsAvatarRemoved() bool
Whether avatar was removed.