gateway

package
v0.0.0-...-3d4fb19 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package gateway implements a websocket client for the Discord gateway.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(t string, opts ...Option) (*Client, error)

func (*Client) Connect

func (c *Client) Connect(pc context.Context) error

func (*Client) OnGuildCreate

func (c *Client) OnGuildCreate(f func(context.Context, *types.Guild))

func (*Client) OnInteractionCreate

func (c *Client) OnInteractionCreate(f func(context.Context, *types.Interaction))

func (*Client) OnMessageCreate

func (c *Client) OnMessageCreate(f func(context.Context, *types.Message))

func (*Client) OnReady

func (c *Client) OnReady(f func(context.Context, *Ready))

type Option

type Option func(*Client)

func Debug

func Debug() Option

type Ready

type Ready struct {
	V         int                       `json:"v"`
	User      *types.User               `json:"user"`
	Guilds    []*types.UnavailableGuild `json:"guilds"`
	SessionID string                    `json:"session_id,omitempty"`
	Shard     [2]int                    `json:"shard,omitempty"`
}

Jump to

Keyboard shortcuts

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