discord

package
v0.0.0-...-0feee84 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JS_FILE_REGEX    = regexp.MustCompile(`assets/+([a-z0-9.]+)\.js`)
	BUILD_INFO_REGEX = regexp.MustCompile(`"([0-9]+)"`)
)

Functions

This section is empty.

Types

type Gateway

type Gateway struct {
	CloseChan  chan struct{}
	Closed     bool
	Config     *types.Config
	Connection *websocket.Conn
	GatewayURL string
	Handlers   Handlers
	LastSeq    int
	Selfbot    *Selfbot
	SessionID  string
	// contains filtered or unexported fields
}

func CreateGateway

func CreateGateway(selfbot *Selfbot, config *types.Config) *Gateway

func (*Gateway) Close

func (gateway *Gateway) Close() error

func (*Gateway) Connect

func (gateway *Gateway) Connect() error

func (*Gateway) GetMembers

func (gateway *Gateway) GetMembers(id string, ids []string) error

type Handlers

type Handlers struct {
	OnReady             []func(data *types.ReadyEventData)
	OnMessageCreate     []func(data *types.MessageEventData)
	OnMessageUpdate     []func(data *types.MessageEventData)
	OnGuildMembersChunk []func(data *types.GuildMembersChunkEventData)
	OnReconnect         []func()

	OnInvalidated []func()
	// contains filtered or unexported fields
}

func (*Handlers) Add

func (handlers *Handlers) Add(event string, function any) error

type Selfbot

type Selfbot struct {
	Token string
	User  types.User
}

Jump to

Keyboard shortcuts

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