discord

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorEventInvalid                = fmt.Errorf("discord: unknown event")
	ErrorEventHandlerFunctionInvalid = fmt.Errorf("discord: unknown event handler function signature")
)

Functions

This section is empty.

Types

type Client

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

func New

func New(apikey string, intents primitives.GatewayIntent) *Client

New Client using specified apikey without a "Bot " prefix

func (*Client) AddHandlerFunc

func (c *Client) AddHandlerFunc(i interface{}) error

func (*Client) Close

func (c *Client) Close() error

func (*Client) Open

func (c *Client) Open() error

type GatewayEventHandler

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

GatewayEventHandler is an event handler specifically for primitives.GatewayEvent(s)

func (*GatewayEventHandler) FireEvent

func (eventHandler *GatewayEventHandler) FireEvent(event primitives.GatewayEvent) error

FireEvent to registered EventHandlerFunctions; can return a ErrorEventInvalid if EventType is unknown

func (*GatewayEventHandler) RegisterEventHandlerFunction

func (eventHandler *GatewayEventHandler) RegisterEventHandlerFunction(handlerFunction interface{}) error

RegisterEventHandlerFunction to be called when an Event is fired

func (*GatewayEventHandler) RemoveEventHandlerFunction

func (eventHandler *GatewayEventHandler) RemoveEventHandlerFunction(handlerFunction interface{}) error

RemoveEventHandlerFunction and prevent it from being called again

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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