Documentation ¶
Overview ¶
Package session abstracts around the REST API and the Gateway, managing both at once. It offers a handler interface similar to that in discordgo for Gateway events.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMFA = errors.New("account has 2FA enabled")
Functions ¶
This section is empty.
Types ¶
type Closed ¶ added in v0.2.0
type Closed struct {
Error error
}
Closed is an event that's sent to Session's command handler. This works by using (*Gateway).AfterClose. If the user sets this callback, no Closed events would be sent.
Usage
ses.AddHandler(func(*session.Closed) {})
type Session ¶
type Session struct { *api.Client Gateway *gateway.Gateway // Command handler with inherited methods. *handler.Handler // MFA only fields MFA bool Ticket string // contains filtered or unexported fields }
Session manages both the API and Gateway. As such, Session inherits all of API's methods, as well has the Handler used for Gateway.
func New ¶
New creates a new session from a given token. Most bots should be using NewWithIntents instead.
func NewWithGateway ¶
func NewWithIntents ¶ added in v0.10.0
Click to show internal directories.
Click to hide internal directories.