Documentation
¶
Index ¶
- Variables
- type Config
- type ConfigOpt
- func WithBrowser(browser string) ConfigOpt
- func WithCompress(compress bool) ConfigOpt
- func WithDevice(device string) ConfigOpt
- func WithGatewayIntents(gatewayIntents ...discord.GatewayIntents) ConfigOpt
- func WithLargeThreshold(largeThreshold int) ConfigOpt
- func WithOS(os string) ConfigOpt
- func WithPresence(presence discord.PresenceUpdate) ConfigOpt
- func WithRateLimiter(rateLimiter grate.Limiter) ConfigOpt
- func WithRateLimiterConfig(rateLimiterConfig grate.Config) ConfigOpt
- func WithRateLimiterConfigOpts(opts ...grate.ConfigOpt) ConfigOpt
- type EventHandlerFunc
- type Gateway
- type Status
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type ConfigOpt ¶
type ConfigOpt func(config *Config)
func WithBrowser ¶
func WithCompress ¶
func WithDevice ¶
func WithGatewayIntents ¶
func WithGatewayIntents(gatewayIntents ...discord.GatewayIntents) ConfigOpt
func WithLargeThreshold ¶
func WithPresence ¶
func WithPresence(presence discord.PresenceUpdate) ConfigOpt
func WithRateLimiter ¶
func WithRateLimiterConfig ¶
type EventHandlerFunc ¶
type EventHandlerFunc func(gatewayEventType discord.GatewayEventType, sequenceNumber int, payload io.Reader)
type Gateway ¶
type Gateway interface {
Logger() log.Logger
Config() Config
ShardID() int
ShardCount() int
Open(ctx context.Context) error
Close(ctx context.Context) error
Status() Status
Send(ctx context.Context, command discord.GatewayCommand) error
Latency() time.Duration
}
Gateway is what is used to connect to discord
type Status ¶
type Status int
Status is the state that the client is currently in
const ( StatusUnconnected Status = iota StatusConnecting StatusReconnecting StatusIdentifying StatusWaitingForHello StatusWaitingForReady StatusWaitingForGuilds StatusReady StatusDisconnected StatusResuming )
Indicates how far along the client is to connecting
func (Status) IsConnected ¶
IsConnected returns whether you can send payloads to the Gateway
Click to show internal directories.
Click to hide internal directories.