Versions in this module Expand all Collapse all v0 v0.0.1 Aug 10, 2020 Changes in this version + var BackoffError = fmt.Errorf("Too many requests") + var HeartbeatError = fmt.Errorf("EventMessage is a heartbeat") + var UnauthorizedError = fmt.Errorf("Request is unauthorized") + var UnknownError = fmt.Errorf("Error was unknown") + type Bot struct + APIKey string + APIURL string + Backoff time.Duration + Client Doer + Email string + Queues []*Queue + Retries int64 + Streams []string + func (b *Bot) GetConfigFromFlags() error + func (b *Bot) GetStreamList() (*http.Response, error) + func (b *Bot) GetStreams() ([]string, error) + func (b *Bot) Init() *Bot + func (b *Bot) ListSubscriptions() (*http.Response, error) + func (b *Bot) Message(m Message) (*http.Response, error) + func (b *Bot) PrivateMessage(m Message) (*http.Response, error) + func (b *Bot) RawRegisterEvents(ets []EventType, n Narrow) (*http.Response, error) + func (b *Bot) React(e EventMessage, emoji string) (*http.Response, error) + func (b *Bot) RealmEmoji() (map[string]*Emoji, error) + func (b *Bot) RealmEmojiSet() (map[string]struct{}, error) + func (b *Bot) RegisterAll() (*Queue, error) + func (b *Bot) RegisterAt() (*Queue, error) + func (b *Bot) RegisterEvents(ets []EventType, n Narrow) (*Queue, error) + func (b *Bot) RegisterPrivate() (*Queue, error) + func (b *Bot) RegisterSubscriptions() (*Queue, error) + func (b *Bot) Respond(e EventMessage, response string) (*http.Response, error) + func (b *Bot) Subscribe(streams []string) (*http.Response, error) + func (b *Bot) Unreact(e EventMessage, emoji string) (*http.Response, error) + func (b *Bot) Unsubscribe(streams []string) (*http.Response, error) + type DisplayRecipient struct + Topic string + Users []User + func (d *DisplayRecipient) UnmarshalJSON(b []byte) (err error) + type Doer interface + Do func(*http.Request) (*http.Response, error) + type Emoji struct + Author string + DisplayURL string + SourceURL string + type EmojiResponse struct + Emoji map[string]*Emoji + Msg string + Result string + type EventMessage struct + AvatarURL string + Client string + Content string + ContentType string + DisplayRecipient DisplayRecipient + GravatarHash string + ID int + Queue *Queue + RecipientID int + SenderDomain string + SenderEmail string + SenderFullName string + SenderID int + SenderShortName string + Subject string + SubjectLinks []interface{} + Timestamp int + Type string + type EventType string + const Messages + const Pointer + const RealmUser + const Subscriptions + type Message struct + Content string + Emails []string + Stream string + Topic string + type Narrow string + const NarrowAt + const NarrowPrivate + type Queue struct + Bot *Bot + ID string + LastEventID int + MaxMessageID int + func (q *Queue) EventsCallback(fn func(EventMessage, error)) func() + func (q *Queue) EventsChan() (chan EventMessage, func()) + func (q *Queue) GetEvents() ([]EventMessage, error) + func (q *Queue) ParseEventMessages(rawEventResponse []byte) ([]EventMessage, error) + func (q *Queue) RawGetEvents() (*http.Response, error) + type StreamJSON struct + Msg string + Result string + Streams []struct{ ... } + type User struct + Domain string + Email string + FullName string + ID int + IsMirrorDummy bool + ShortName string