events

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Event

	Type string `json:"event_type"`
}

An auth event, its special because of the event type stuff

type Auth_DeleteAllSessions

type Auth_DeleteAllSessions struct {
	Auth

	// User Id
	Id string `json:"user_id"`

	// <Session Id to exclude from deletion>
	ExcludeSessionId string `json:"exclude_session_id"`
}

type Auth_DeleteSession

type Auth_DeleteSession struct {
	Auth

	// User Id
	Id string `json:"user_id"`

	// Session Id
	SessionId string `json:"session_id"`
}

type Authenticated

type Authenticated struct {
	Event
}

type Bulk

type Bulk struct {
	Event
	V []map[string]any `json:"v"`
}

type ChannelAck

type ChannelAck struct {
	Event

	// Channel Id
	Id string `json:"id"`

	// User Id
	UserId string `json:"user"`

	// Message id
	MessageId string `json:"message_id"`
}

type ChannelCreate

type ChannelCreate struct {
	Event
	*types.Channel
}

type ChannelDelete

type ChannelDelete struct {
	Event

	// Channel Id
	Id string `json:"id"`
}

type ChannelGroupJoin

type ChannelGroupJoin struct {
	Event

	// Channel Id
	Id string `json:"id"`

	// User Id
	UserId string `json:"user"`
}

type ChannelGroupLeave

type ChannelGroupLeave struct {
	Event

	// Channel Id
	Id string `json:"id"`

	// User Id
	UserId string `json:"user"`
}

type ChannelStartTyping

type ChannelStartTyping struct {
	Event

	// Channel Id
	Id string `json:"id"`

	// User Id
	UserId string `json:"user"`
}

type ChannelStopTyping

type ChannelStopTyping struct {
	Event

	// Channel Id
	Id string `json:"id"`

	// User Id
	UserId string `json:"user"`
}

type ChannelUpdate

type ChannelUpdate struct {
	Event

	// Channel ID
	Id string `json:"id"`

	// Partial channel object, not all data is available
	//
	// Exactly which fields are available is subject to change and thus not documented.
	Data *types.Channel `json:"data"`

	// Clear is a field to remove, one of Icon/Description
	//
	// Grevolt plays it safe here, and uses the FieldsChannel type already used
	// throughout the API just in case the docs are out-of-date.
	//
	// This does not affect users, as it expands and not reduces the possible
	// values.
	Clear []types.FieldsChannel `json:"clear"`
}

type EmojiCreate

type EmojiCreate struct {
	Event
	*types.Emoji
}

type EmojiDelete

type EmojiDelete struct {
	Event

	// Emoji Id
	Id string `json:"id"`
}

type Error

type Error struct {
	Event
	Error string `json:"error"`
}

type Event

type Event struct {
	Type string `json:"type"`
}

func (Event) EventType

func (e Event) EventType() string

type EventInterface

type EventInterface interface {
	EventType() string
}

type Message

type Message struct {
	Event
	*types.Message
}

type MessageAppend

type MessageAppend struct {
	Event

	// The message ID
	Id string `json:"id"`

	// Channel ID
	ChannelId string `json:"channel"`

	// Partial message object, not all data is available
	//
	// Exactly which fields are available is subject to change and not documented.
	Append *MessageAppendData `json:"append"`
}

type MessageAppendData

type MessageAppendData struct {
	// Embeds in the message
	Embeds []*types.MessageEmbed `json:"embeds,omitempty"`
}

Work in progress, not well documented

type MessageDelete

type MessageDelete struct {
	Event

	// The message ID
	Id string `json:"id"`

	// Channel ID
	ChannelId string `json:"channel"`

	// Undocumented but it exists?
	Ids []string `json:"ids,omitempty"`
}

type MessageReact

type MessageReact struct {
	Event

	// The message ID
	Id string `json:"id"`

	// Channel ID
	ChannelId string `json:"channel_id"`

	// User ID <who made the reaction>
	UserId string `json:"user_id"`

	// Emoji ID <of the reaction>
	EmojiId string `json:"emoji_id"`
}

type MessageRemoveReaction

type MessageRemoveReaction struct {
	Event

	// The message ID
	Id string `json:"id"`

	// Channel ID
	ChannelId string `json:"channel_id"`

	// Emoji ID <of the reaction>
	EmojiId string `json:"emoji_id"`
}

type MessageUnreact

type MessageUnreact struct {
	Event

	// The message ID
	Id string `json:"id"`

	// Channel ID
	ChannelId string `json:"channel_id"`

	// User ID <who made the reaction>
	UserId string `json:"user_id"`

	// Emoji ID <of the reaction>
	EmojiId string `json:"emoji_id"`
}

type MessageUpdate

type MessageUpdate struct {
	Event

	// The message ID
	Id string `json:"id"`

	// Channel ID
	ChannelId string `json:"channel"`

	// Partial message object, not all data is available
	//
	// Exactly which fields are available is subject to change and thus not documented.
	Data *types.Message `json:"data"`
}

type Pong

type Pong struct {
	Event
	Data int64 `json:"data"` // unix timestamp
}

type Ready

type Ready struct {
	Event
	Users    []*types.User    `json:"users,omitempty"`
	Servers  []*types.Server  `json:"servers,omitempty"`
	Channels []*types.Channel `json:"channels,omitempty"`
	Members  []*types.Member  `json:"members,omitempty"`
	Emojis   []*types.Emoji   `json:"emojis,omitempty"`
}

type ReportCreate

type ReportCreate struct {
	Event
	*types.Report
}

type ServerCreate

type ServerCreate struct {
	Event
	*types.Server

	// <undocumented, may exist???>
	Channels []*types.Channel `json:"channels,omitempty"`
}

type ServerDelete

type ServerDelete struct {
	Event

	// Server Id
	Id string `json:"id"`
}

type ServerMemberJoin

type ServerMemberJoin struct {
	Event

	// Server Id
	Id string `json:"id"`

	// User Id
	UserId string `json:"user"`
}

type ServerMemberLeave

type ServerMemberLeave struct {
	Event

	// Server Id
	Id string `json:"id"`

	// User Id
	UserId string `json:"user"`
}

type ServerMemberUpdate

type ServerMemberUpdate struct {
	Event

	// Ids
	Id *types.MemberId `json:"id"`

	// Partial server member object, not all data is available
	//
	// Exactly which fields are available is subject to change and thus not documented.
	Data *types.Member `json:"data"`

	// Clear is a field to remove, one of Nickname/Avatar
	//
	// Grevolt plays it safe here, and uses the FieldsServer type already used
	// throughout the API just in case the docs are out-of-date.
	//
	// This does not affect users, as it expands and not reduces the possible
	// values.
	Clear []types.FieldsMember `json:"clear"`
}

type ServerRoleDelete

type ServerRoleDelete struct {
	Event

	// Server ID
	Id string `json:"id"`

	// Role ID
	RoleId string `json:"role_id"`
}

type ServerRoleUpdate

type ServerRoleUpdate struct {
	Event

	// Server ID
	Id string `json:"id"`

	// Role ID
	RoleId string `json:"role_id"`

	// Partial channel object, not all data is available
	//
	// Exactly which fields are available is subject to change and thus not documented.
	Data *types.Role `json:"data"`

	// Clear is a field to remove, one of Colour
	//
	// Grevolt plays it safe here, and uses the FieldsRole type already used
	// throughout the API just in case the docs are out-of-date.
	//
	// This does not affect users, as it expands and not reduces the possible
	// values.
	Clear []types.FieldsRole `json:"clear"`
}

type ServerUpdate

type ServerUpdate struct {
	Event

	// Server ID
	Id string `json:"id"`

	// Partial server object, not all data is available
	//
	// Exactly which fields are available is subject to change and thus not documented.
	Data *types.Server `json:"data"`

	// Clear is a field to remove, one of Icon/Banner/Description
	//
	// Grevolt plays it safe here, and uses the FieldsServer type already used
	// throughout the API just in case the docs are out-of-date.
	//
	// This does not affect users, as it expands and not reduces the possible
	// values.
	Clear []types.FieldsServer `json:"clear"`
}

type UserPlatformWipe

type UserPlatformWipe struct {
	Event

	// User Id
	UserId string `json:"user_id"`

	// <officially, this is a i32, but we use i64 to make room for future flags and for consistency>
	Flags int64
}

type UserRelationship

type UserRelationship struct {
	Event

	// Your user Id
	//
	// <the your above is very important, its the currently logged in user id, not the
	// new relationship's user id>
	Id string `json:"id"`

	// <not well documented, its likely the new relationship's user object>
	User *types.User `json:"user"`

	// <relationship status, same as API>
	//
	// <in source code, this is mentioned as deprecated, so avoid using this field>
	Relationship types.RelationshipStatus `json:"status"`
}

type UserSettingsUpdate

type UserSettingsUpdate struct {
	Event

	// User Id
	UserId string `json:"user_id"`

	// User settings
	//
	// <until better documentation is released, you're on your own>
	Update map[string]any `json:"update"`
}

<undocumented, will likely be available in a future release>

type UserUpdate

type UserUpdate struct {
	Event

	// User Id
	Id string `json:"id"`

	// Partial channel object, not all data is available
	//
	// Exactly which fields are available is subject to change and thus not documented.
	Data *types.User `json:"data"`

	// Clear is a field to remove, one of ProfileContent/ProfileBackground/StatusText/Avatar
	//
	// Grevolt plays it safe here, and uses the FieldsServer type already used
	// throughout the API just in case the docs are out-of-date.
	//
	// This does not affect users, as it expands and not reduces the possible
	// values.
	Clear []types.FieldsUser `json:"clear"`

	// <undocumented, may exist???>
	EventId string `json:"event_id,omitempty"`
}

type WebhookCreate

type WebhookCreate struct {
	Event
	*types.Webhook
}

type WebhookDelete

type WebhookDelete struct {
	Event

	// Webhook ID
	Id string `json:"id"`
}

type WebhookUpdate

type WebhookUpdate struct {
	Event

	// Server ID
	Id string `json:"id"`

	// Partial webhook object, not all data is available
	//
	// Exactly which fields are available is subject to change and thus not documented.
	Data *types.Webhook `json:"data"`

	// Clear is a field to remove, one of <undocumented>
	//
	// Grevolt plays it safe here, and uses the FieldsWebhook type already used
	// throughout the API just in case the docs are out-of-date.
	//
	// This does not affect users, as it expands and not reduces the possible
	// values.
	Clear []types.FieldsWebhook `json:"clear"`
}

Jump to

Keyboard shortcuts

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