Documentation ¶
Index ¶
- Constants
- type DiscordCloseCode
- type Heartbeat
- type IdentifyLocker
- type ReadResult
- type Shard
- type ShardError
- type ShardOption
- func WithDispatcher(d dispatcher.Dispatcher) ShardOption
- func WithGatewayURL(u string) ShardOption
- func WithIdentifyLock(l IdentifyLocker) ShardOption
- func WithInitialPresence(p objects.UpdatePresence) ShardOption
- func WithIntents(i objects.Intent) ShardOption
- func WithLogger(l zerolog.Logger) ShardOption
- func WithShardInfo(id, count int) ShardOption
- type Websocket
Constants ¶
View Source
const ( GatewayDefaultURL = "wss://gateway.discord.gg/" GatewayVersion = 10 GatewayEncoding = "json" GatewayAddressFmt = "%s/?v=%d&encoding=%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscordCloseCode ¶
type DiscordCloseCode int64
const ( CloseUnknownError DiscordCloseCode = iota + 4000 CloseUnknownOpcode CloseDecodeError CloseNotAuthenticated CloseAuthenticationFailed CloseAlreadyAuthenticated CloseInvalidSeq CloseRateLimited CloseSessionTimeout CloseInvalidShard CloseShardingRequired CloseInvalidAPIVersion CloseInvalidIntents CloseDisallowedIntents )
func (DiscordCloseCode) String ¶
func (d DiscordCloseCode) String() string
type Heartbeat ¶
type Heartbeat struct {
// contains filtered or unexported fields
}
func NewHeartbeat ¶
func (*Heartbeat) SendHeartbeat ¶
type IdentifyLocker ¶ added in v0.0.4
type IdentifyLocker interface { Lock() Unlock() }
type ReadResult ¶ added in v0.0.5
type Shard ¶
type Shard struct {
// contains filtered or unexported fields
}
Shard represents a single Shard connection
func New ¶
func New(token string, opts ...ShardOption) *Shard
func (*Shard) IsIdentified ¶
func (*Shard) MarshalZerologObject ¶ added in v0.0.4
type ShardError ¶ added in v0.0.5
type ShardError struct {
Message string
}
func (ShardError) Error ¶ added in v0.0.5
func (s ShardError) Error() string
type ShardOption ¶
type ShardOption func(*Shard)
func WithDispatcher ¶
func WithDispatcher(d dispatcher.Dispatcher) ShardOption
func WithGatewayURL ¶
func WithGatewayURL(u string) ShardOption
func WithIdentifyLock ¶ added in v0.0.4
func WithIdentifyLock(l IdentifyLocker) ShardOption
func WithInitialPresence ¶
func WithInitialPresence(p objects.UpdatePresence) ShardOption
func WithIntents ¶
func WithIntents(i objects.Intent) ShardOption
func WithLogger ¶
func WithLogger(l zerolog.Logger) ShardOption
func WithShardInfo ¶
func WithShardInfo(id, count int) ShardOption
type Websocket ¶
type Websocket struct {
// contains filtered or unexported fields
}
func NewWebsocket ¶
func (*Websocket) IsConnected ¶
Click to show internal directories.
Click to hide internal directories.