Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (ec *Client) AddHandler(topic string, handler interface{})
- func (ec *Client) Close()
- func (ec *Client) DiscordMessageChannelEmitter(msg *hivelib.ChatMessage) error
- func (ec *Client) DiscordMessagePrivateEmitter(msg *hivelib.ChatMessage) error
- func (ec *Client) DiscordUserActionEmitter(action *hivelib.ChatUserAction) error
- func (ec *Client) Run() error
- func (ec *Client) Subscribe(topics ...string) error
- type EventHandler
- type EventInterfaceProvider
Constants ¶
View Source
const ExchangeName = "events"
Variables ¶
View Source
var ( // complete event types EventTypeDiscordAll = eventTypeDiscord + ".*.*" EventTypeDiscordMessageAll = eventTypeDiscordMessage + ".*" EventTypeDiscordMessageChannel = eventTypeDiscordMessage + ".channel" EventTypeDiscordMessagePrivate = eventTypeDiscordMessage + ".private" EventTypeDiscordUserAction = eventTypeDiscordUser + ".action" )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddHandler ¶
func (*Client) DiscordMessageChannelEmitter ¶
func (*Client) DiscordMessagePrivateEmitter ¶
func (*Client) DiscordUserActionEmitter ¶
type EventHandler ¶
type EventHandler interface { // Handle is called whenever an event of Type() happens. // It is the receivers responsibility to type assert that the interface // is the expected struct. Handle(*Client, interface{}) }
type EventInterfaceProvider ¶
type EventInterfaceProvider interface { // New returns a new instance of the struct this event handler handles. // This is called once per event. New() interface{} }
Click to show internal directories.
Click to hide internal directories.