Versions in this module Expand all Collapse all v20 v20.0.0 Oct 22, 2021 Changes in this version + func ETFPayloadToMessage(ctx context.Context, ep ETFPayload) (wsapi.WSMessage, error) + type DispatchHandlerFunc = func(Payload, wsapi.WSMessage, chan<- wsapi.WSMessage) snowflake.Snowflake + type Dispatcher struct + func NewDispatcher(deps dependencies) *Dispatcher + func (c *Dispatcher) AddHandler(event string, handler DispatchHandlerFunc) + func (c *Dispatcher) ConnectToBot(b *bot.DiscordBot) + func (c *Dispatcher) GenerateHeartbeat(reqCtx context.Context, seqNum int) (wsapi.WSMessage, error) + func (c *Dispatcher) HandleRequest(req wsapi.WSMessage, resp chan<- wsapi.WSMessage) snowflake.Snowflake + func (c *Dispatcher) SetDebug(val bool) + type ETFPayload interface + Payload func() (etf.Payload, error) + type Logger = interface + Err func(string, error, ...interface{}) + Log func(keyvals ...interface{}) error + Message func(string, ...interface{}) + Printf func(string, ...interface{}) + type Message struct + func MessageFromElement(e etf.Element) (Message, error) + func MessageFromElementMap(eMap map[string]etf.Element) (Message, error) + func (m *Message) AuthorID() snowflake.Snowflake + func (m *Message) ChannelID() snowflake.Snowflake + func (m *Message) ContentString() string + func (m *Message) ID() snowflake.Snowflake + func (m *Message) MessageType() MessageType + type MessageType int + const CallMessage + const ChannelIconChangeMessage + const ChannelNameChangeMessage + const ChannelPinnedMessageMessage + const DefaultMessage + const GuildMemberJoinMessage + const RecipientAddMessage + const RecipientRemoveMessage + func MessageTypeFromElement(e etf.Element) (MessageType, error) + func (t MessageType) String() string + type Payload = interface + Contents func() map[string]etf.Element + EventName func() string + type Reaction struct + func ReactionFromElement(e etf.Element) (Reaction, error) + func ReactionFromElementMap(eMap map[string]etf.Element) (Reaction, error) + func (r *Reaction) ChannelID() snowflake.Snowflake + func (r *Reaction) Emoji() string + func (r *Reaction) GuildID() snowflake.Snowflake + func (r *Reaction) MessageID() snowflake.Snowflake + func (r *Reaction) UserID() snowflake.Snowflake + type User struct + func UserFromElement(e etf.Element) (User, error) + func (u *User) UpdateFromElementMap(eMap map[string]etf.Element) error Other modules containing this package github.com/gsmcwhirter/discord-bot-lib/v19 github.com/gsmcwhirter/discord-bot-lib/v21 github.com/gsmcwhirter/discord-bot-lib/v22 github.com/gsmcwhirter/discord-bot-lib/v23 github.com/gsmcwhirter/discord-bot-lib/v24