payloads

package
v18.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ETFPayloadToMessage

func ETFPayloadToMessage(ctx context.Context, ep ETFPayload) (wsclient.WSMessage, error)

ETFPayloadToMessage converts a specialized etf payload to a websocket message

Types

type ETFPayload

type ETFPayload interface {
	Payload() (etfapi.Payload, error)
}

ETFPayload is the interface that a specialized etf api payload conforms to

type HeartbeatPayload

type HeartbeatPayload struct {
	Sequence int
}

HeartbeatPayload is the specialized payload for sending "heartbeat" events to the discord gateway websocket

func (*HeartbeatPayload) Payload

func (hp *HeartbeatPayload) Payload() (etfapi.Payload, error)

Payload converts the specialized payload to a generic etfapi.Payload

type IdentifyPayload

type IdentifyPayload struct {
	Token          string
	Intents        int
	Properties     IdentifyPayloadProperties
	LargeThreshold int
	Shard          IdentifyPayloadShard
	Presence       IdentifyPayloadPresence
}

IdentifyPayload is the specialized payload for sending "Identify" events to the discord gateway websocket

func (*IdentifyPayload) Payload

func (ip *IdentifyPayload) Payload() (etfapi.Payload, error)

Payload converts the specialized payload to a generic etfapi.Payload

type IdentifyPayloadGame

type IdentifyPayloadGame struct {
	Name string
	Type int
}

IdentifyPayloadGame holds the data about the "game" portion of the presence

type IdentifyPayloadPresence

type IdentifyPayloadPresence struct {
	Game   IdentifyPayloadGame
	Status string
	Since  int
	AFK    bool
}

IdentifyPayloadPresence holds the data about the "presence" portion of the identify payload

type IdentifyPayloadProperties

type IdentifyPayloadProperties struct {
	OS      string
	Browser string
	Device  string
}

IdentifyPayloadProperties holds the data about the os, etc. of the bot when identifying

type IdentifyPayloadShard

type IdentifyPayloadShard struct {
	ID    int
	MaxID int
}

IdentifyPayloadShard holds the data about the shards being identified for

type ResumePayload

type ResumePayload struct {
	Token     string
	SessionID string
	SeqNum    int
}

ResumePayload is the specialized payload for sending "Resume" events to the discord gateway websocket

func (*ResumePayload) Payload

func (rp *ResumePayload) Payload() (etfapi.Payload, error)

Payload converts the specialized payload to a generic etfapi.Payload

Jump to

Keyboard shortcuts

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