Versions in this module Expand all Collapse all v0 v0.0.2 Jan 31, 2020 v0.0.1 Jan 30, 2020 Changes in this version + type Bot struct + API MessagingClient + CircuitBreaker *CircuitBreaker + DebugChannel string + DirectListeners []Listener + Exchanges []Exchange + FallbackMessage string + IndirectListeners []Listener + ScheduledTasks []ScheduledTask + Store Store + Token string + func (bot *Bot) LogDebug(msg string) + func (bot *Bot) Reply(channel string, text string) (respChannel string, timestamp string, err error) + func (bot *Bot) ReplyInThread(channel string, thread string, text string) (respChannel string, timestamp string, err error) + func (bot *Bot) ReplyWithOptions(channel string, options ...slack.MsgOption) (respChannel string, timestamp string, err error) + func (bot *Bot) SendHelp(channel string, thread string, msg string) (respChannel string, timestamp string, err error) + func (bot *Bot) Start() error + type CircuitBreaker struct + MaxMessages int + TimeInterval time.Duration + type Exchange struct + Bot *Bot + Channel string + Regex *regexp.Regexp + Steps map[int]*Step + Store Store + Thread string + Usage string + User string + func (ex *Exchange) GetCurrentStep() (*Step, error) + func (ex *Exchange) Reply(msg string) + func (ex *Exchange) ReplyWithOptions(options ...slack.MsgOption) + func (ex *Exchange) SendDefaultErrorMessage(err error) error + func (ex *Exchange) SkipToStep(i int) error + func (ex *Exchange) Terminate() + type Listener struct + Handler func(bot *Bot, ev *slack.MessageEvent) + Regex *regexp.Regexp + Usage string + type MessagingClient interface + AddChannelReminder func(string, string, string) (*slack.Reminder, error) + AddPin func(string, slack.ItemRef) error + AddPinContext func(context.Context, string, slack.ItemRef) error + AddReaction func(string, slack.ItemRef) error + AddReactionContext func(context.Context, string, slack.ItemRef) error + AddStar func(string, slack.ItemRef) error + AddStarContext func(context.Context, string, slack.ItemRef) error + AddUserReminder func(string, string, string) (*slack.Reminder, error) + ArchiveChannel func(string) error + ArchiveChannelContext func(context.Context, string) error + ArchiveConversation func(string) error + ArchiveConversationContext func(context.Context, string) error + ArchiveGroup func(string) error + ArchiveGroupContext func(context.Context, string) error + AuthTest func() (*slack.AuthTestResponse, error) + AuthTestContext func(context.Context) (*slack.AuthTestResponse, error) + CloseConversation func(string) (bool, bool, error) + CloseConversationContext func(context.Context, string) (bool, bool, error) + CloseIMChannel func(string) (bool, bool, error) + CloseIMChannelContext func(context.Context, string) (bool, bool, error) + ConnectRTM func() (*slack.Info, string, error) + ConnectRTMContext func(context.Context) (*slack.Info, string, error) + CreateChannel func(string) (*slack.Channel, error) + CreateChannelContext func(context.Context, string) (*slack.Channel, error) + CreateChildGroup func(string) (*slack.Group, error) + CreateChildGroupContext func(context.Context, string) (*slack.Group, error) + CreateConversation func(string, bool) (*slack.Channel, error) + CreateConversationContext func(context.Context, string, bool) (*slack.Channel, error) + CreateGroup func(string) (*slack.Group, error) + CreateGroupContext func(context.Context, string) (*slack.Group, error) + CreateUserGroup func(slack.UserGroup) (slack.UserGroup, error) + CreateUserGroupContext func(context.Context, slack.UserGroup) (slack.UserGroup, error) + Debug func() bool + Debugf func(string, ...interface{}) + Debugln func(...interface{}) + DeleteFile func(string) error + DeleteFileComment func(string, string) error + DeleteFileCommentContext func(context.Context, string, string) error + DeleteFileContext func(context.Context, string) error + DeleteMessage func(string, string) (string, string, error) + DeleteMessageContext func(context.Context, string, string) (string, string, error) + DeleteReminder func(string) error + DeleteUserPhoto func() error + DeleteUserPhotoContext func(context.Context) error + DisableUser func(string, string) error + DisableUserContext func(context.Context, string, string) error + DisableUserGroup func(string) (slack.UserGroup, error) + DisableUserGroupContext func(context.Context, string) (slack.UserGroup, error) + Disconnect func() error + EnableUserGroup func(string) (slack.UserGroup, error) + EnableUserGroupContext func(context.Context, string) (slack.UserGroup, error) + EndDND func() error + EndDNDContext func(context.Context) error + EndSnooze func() (*slack.DNDStatus, error) + EndSnoozeContext func(context.Context) (*slack.DNDStatus, error) + GetAccessLogs func(slack.AccessLogParameters) ([]slack.Login, *slack.Paging, error) + GetAccessLogsContext func(context.Context, slack.AccessLogParameters) ([]slack.Login, *slack.Paging, error) + GetBillableInfo func(string) (map[string]slack.BillingActive, error) + GetBillableInfoContext func(context.Context, string) (map[string]slack.BillingActive, error) + GetBillableInfoForTeam func() (map[string]slack.BillingActive, error) + GetBillableInfoForTeamContext func(context.Context) (map[string]slack.BillingActive, error) + GetBotInfo func(string) (*slack.Bot, error) + GetBotInfoContext func(context.Context, string) (*slack.Bot, error) + GetChannel func(string) (slack.Channel, error) + GetChannelHistory func(string, slack.HistoryParameters) (*slack.History, error) + GetChannelHistoryContext func(context.Context, string, slack.HistoryParameters) (*slack.History, error) + GetChannelInfo func(string) (*slack.Channel, error) + GetChannelInfoContext func(context.Context, string) (*slack.Channel, error) + GetChannelReplies func(string, string) ([]slack.Message, error) + GetChannelRepliesContext func(context.Context, string, string) ([]slack.Message, error) + GetChannels func(bool, ...slack.GetChannelsOption) ([]slack.Channel, error) + GetChannelsContext func(context.Context, bool, ...slack.GetChannelsOption) ([]slack.Channel, error) + GetConversationHistory func(*slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error) + GetConversationHistoryContext func(context.Context, *slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error) + GetConversationInfo func(string, bool) (*slack.Channel, error) + GetConversationInfoContext func(context.Context, string, bool) (*slack.Channel, error) + GetConversationReplies func(*slack.GetConversationRepliesParameters) ([]slack.Message, bool, string, error) + GetConversationRepliesContext func(context.Context, *slack.GetConversationRepliesParameters) ([]slack.Message, bool, string, error) + GetConversations func(*slack.GetConversationsParameters) ([]slack.Channel, string, error) + GetConversationsContext func(context.Context, *slack.GetConversationsParameters) ([]slack.Channel, string, error) + GetConversationsForUser func(*slack.GetConversationsForUserParameters) ([]slack.Channel, string, error) + GetConversationsForUserContext func(context.Context, *slack.GetConversationsForUserParameters) ([]slack.Channel, string, error) + GetDNDInfo func(*string) (*slack.DNDStatus, error) + GetDNDInfoContext func(context.Context, *string) (*slack.DNDStatus, error) + GetDNDTeamInfo func([]string) (map[string]slack.DNDStatus, error) + GetDNDTeamInfoContext func(context.Context, []string) (map[string]slack.DNDStatus, error) + GetEmoji func() (map[string]string, error) + GetEmojiContext func(context.Context) (map[string]string, error) + GetFile func(string, io.Writer) error + GetFileInfo func(string, int, int) (*slack.File, []slack.Comment, *slack.Paging, error) + GetFileInfoContext func(context.Context, string, int, int) (*slack.File, []slack.Comment, *slack.Paging, error) + GetFiles func(slack.GetFilesParameters) ([]slack.File, *slack.Paging, error) + GetFilesContext func(context.Context, slack.GetFilesParameters) ([]slack.File, *slack.Paging, error) + GetGroupHistory func(string, slack.HistoryParameters) (*slack.History, error) + GetGroupHistoryContext func(context.Context, string, slack.HistoryParameters) (*slack.History, error) + GetGroupInfo func(string) (*slack.Group, error) + GetGroupInfoContext func(context.Context, string) (*slack.Group, error) + GetGroups func(bool) ([]slack.Group, error) + GetGroupsContext func(context.Context, bool) ([]slack.Group, error) + GetIMChannels func() ([]slack.IM, error) + GetIMChannelsContext func(context.Context) ([]slack.IM, error) + GetIMHistory func(string, slack.HistoryParameters) (*slack.History, error) + GetIMHistoryContext func(context.Context, string, slack.HistoryParameters) (*slack.History, error) + GetIncomingEvents func() chan slack.RTMEvent + GetInfo func() *slack.Info + GetPermalink func(*slack.PermalinkParameters) (string, error) + GetPermalinkContext func(context.Context, *slack.PermalinkParameters) (string, error) + GetReactions func(slack.ItemRef, slack.GetReactionsParameters) ([]slack.ItemReaction, error) + GetReactionsContext func(context.Context, slack.ItemRef, slack.GetReactionsParameters) ([]slack.ItemReaction, error) + GetStarred func(slack.StarsParameters) ([]slack.StarredItem, *slack.Paging, error) + GetStarredContext func(context.Context, slack.StarsParameters) ([]slack.StarredItem, *slack.Paging, error) + GetTeamInfo func() (*slack.TeamInfo, error) + GetTeamInfoContext func(context.Context) (*slack.TeamInfo, error) + GetUser func(string) (slack.User, error) + GetUserByEmail func(string) (*slack.User, error) + GetUserByEmailContext func(context.Context, string) (*slack.User, error) + GetUserGroupMembers func(string) ([]string, error) + GetUserGroupMembersContext func(context.Context, string) ([]string, error) + GetUserGroups func(...slack.GetUserGroupsOption) ([]slack.UserGroup, error) + GetUserGroupsContext func(context.Context, ...slack.GetUserGroupsOption) ([]slack.UserGroup, error) + GetUserIdentity func() (*slack.UserIdentityResponse, error) + GetUserIdentityContext func(context.Context) (*slack.UserIdentityResponse, error) + GetUserInfo func(string) (*slack.User, error) + GetUserInfoContext func(context.Context, string) (*slack.User, error) + GetUserPresence func(string) (*slack.UserPresence, error) + GetUserPresenceContext func(context.Context, string) (*slack.UserPresence, error) + GetUserProfile func(string, bool) (*slack.UserProfile, error) + GetUserProfileContext func(context.Context, string, bool) (*slack.UserProfile, error) + GetUsers func() ([]slack.User, error) + GetUsersContext func(context.Context) ([]slack.User, error) + GetUsersInConversation func(*slack.GetUsersInConversationParameters) ([]string, string, error) + GetUsersInConversationContext func(context.Context, *slack.GetUsersInConversationParameters) ([]string, string, error) + GetUsersPaginated func(...slack.GetUsersOption) slack.UserPagination + InviteGuest func(string, string, string, string, string) error + InviteGuestContext func(context.Context, string, string, string, string, string) error + InviteRestricted func(string, string, string, string, string) error + InviteRestrictedContext func(context.Context, string, string, string, string, string) error + InviteToTeam func(string, string, string, string) error + InviteToTeamContext func(context.Context, string, string, string, string) error + InviteUserToChannel func(string, string) (*slack.Channel, error) + InviteUserToChannelContext func(context.Context, string, string) (*slack.Channel, error) + InviteUserToGroup func(string, string) (*slack.Group, bool, error) + InviteUserToGroupContext func(context.Context, string, string) (*slack.Group, bool, error) + InviteUsersToConversation func(string, ...string) (*slack.Channel, error) + InviteUsersToConversationContext func(context.Context, string, ...string) (*slack.Channel, error) + JoinChannel func(string) (*slack.Channel, error) + JoinChannelContext func(context.Context, string) (*slack.Channel, error) + JoinConversation func(string) (*slack.Channel, string, []string, error) + JoinConversationContext func(context.Context, string) (*slack.Channel, string, []string, error) + KickUserFromChannel func(string, string) error + KickUserFromChannelContext func(context.Context, string, string) error + KickUserFromConversation func(string, string) error + KickUserFromConversationContext func(context.Context, string, string) error + KickUserFromGroup func(string, string) error + KickUserFromGroupContext func(context.Context, string, string) error + LeaveChannel func(string) (bool, error) + LeaveChannelContext func(context.Context, string) (bool, error) + LeaveConversation func(string) (bool, error) + LeaveConversationContext func(context.Context, string) (bool, error) + LeaveGroup func(string) error + LeaveGroupContext func(context.Context, string) error + ListFiles func(slack.ListFilesParameters) ([]slack.File, *slack.ListFilesParameters, error) + ListFilesContext func(context.Context, slack.ListFilesParameters) ([]slack.File, *slack.ListFilesParameters, error) + ListPins func(string) ([]slack.Item, *slack.Paging, error) + ListPinsContext func(context.Context, string) ([]slack.Item, *slack.Paging, error) + ListReactions func(slack.ListReactionsParameters) ([]slack.ReactedItem, *slack.Paging, error) + ListReactionsContext func(context.Context, slack.ListReactionsParameters) ([]slack.ReactedItem, *slack.Paging, error) + ListStars func(slack.StarsParameters) ([]slack.Item, *slack.Paging, error) + ListStarsContext func(context.Context, slack.StarsParameters) ([]slack.Item, *slack.Paging, error) + ManageConnection func() + MarkIMChannel func(string, string) error + MarkIMChannelContext func(context.Context, string, string) error + NewOutgoingMessage func(string, string, ...slack.RTMsgOption) *slack.OutgoingMessage + NewRTM func(...slack.RTMOption) *slack.RTM + NewSubscribeUserPresence func([]string) *slack.OutgoingMessage + NewTypingMessage func(string) *slack.OutgoingMessage + OpenConversation func(*slack.OpenConversationParameters) (*slack.Channel, bool, bool, error) + OpenConversationContext func(context.Context, *slack.OpenConversationParameters) (*slack.Channel, bool, bool, error) + OpenDialog func(string, slack.Dialog) error + OpenDialogContext func(context.Context, string, slack.Dialog) error + OpenGroup func(string) (bool, bool, error) + OpenGroupContext func(context.Context, string) (bool, bool, error) + OpenIMChannel func(string) (bool, bool, string, error) + OpenIMChannelContext func(context.Context, string) (bool, bool, string, error) + PostEphemeral func(string, string, ...slack.MsgOption) (string, error) + PostEphemeralContext func(context.Context, string, string, ...slack.MsgOption) (string, error) + PostMessage func(string, ...slack.MsgOption) (string, string, error) + PostMessageContext func(context.Context, string, ...slack.MsgOption) (string, string, error) + RemovePin func(string, slack.ItemRef) error + RemovePinContext func(context.Context, string, slack.ItemRef) error + RemoveReaction func(string, slack.ItemRef) error + RemoveReactionContext func(context.Context, string, slack.ItemRef) error + RemoveStar func(string, slack.ItemRef) error + RemoveStarContext func(context.Context, string, slack.ItemRef) error + RenameChannel func(string, string) (*slack.Channel, error) + RenameChannelContext func(context.Context, string, string) (*slack.Channel, error) + RenameConversation func(string, string) (*slack.Channel, error) + RenameConversationContext func(context.Context, string, string) (*slack.Channel, error) + RenameGroup func(string, string) (*slack.Channel, error) + RenameGroupContext func(context.Context, string, string) (*slack.Channel, error) + RevokeFilePublicURL func(string) (*slack.File, error) + RevokeFilePublicURLContext func(context.Context, string) (*slack.File, error) + Search func(string, slack.SearchParameters) (*slack.SearchMessages, *slack.SearchFiles, error) + SearchContext func(context.Context, string, slack.SearchParameters) (*slack.SearchMessages, *slack.SearchFiles, error) + SearchFiles func(string, slack.SearchParameters) (*slack.SearchFiles, error) + SearchFilesContext func(context.Context, string, slack.SearchParameters) (*slack.SearchFiles, error) + SearchMessages func(string, slack.SearchParameters) (*slack.SearchMessages, error) + SearchMessagesContext func(context.Context, string, slack.SearchParameters) (*slack.SearchMessages, error) + SendAuthRevoke func(string) (*slack.AuthRevokeResponse, error) + SendAuthRevokeContext func(context.Context, string) (*slack.AuthRevokeResponse, error) + SendMessage func(*slack.OutgoingMessage) + SendMessageContext func(context.Context, string, ...slack.MsgOption) (string, string, string, error) + SendSSOBindingEmail func(string, string) error + SendSSOBindingEmailContext func(context.Context, string, string) error + SetChannelPurpose func(string, string) (string, error) + SetChannelPurposeContext func(context.Context, string, string) (string, error) + SetChannelReadMark func(string, string) error + SetChannelReadMarkContext func(context.Context, string, string) error + SetChannelTopic func(string, string) (string, error) + SetChannelTopicContext func(context.Context, string, string) (string, error) + SetGroupPurpose func(string, string) (string, error) + SetGroupPurposeContext func(context.Context, string, string) (string, error) + SetGroupReadMark func(string, string) error + SetGroupReadMarkContext func(context.Context, string, string) error + SetGroupTopic func(string, string) (string, error) + SetGroupTopicContext func(context.Context, string, string) (string, error) + SetPurposeOfConversation func(string, string) (*slack.Channel, error) + SetPurposeOfConversationContext func(context.Context, string, string) (*slack.Channel, error) + SetRegular func(string, string) error + SetRegularContext func(context.Context, string, string) error + SetRestricted func(string, string, ...string) error + SetRestrictedContext func(context.Context, string, string, ...string) error + SetSnooze func(int) (*slack.DNDStatus, error) + SetSnoozeContext func(context.Context, int) (*slack.DNDStatus, error) + SetTopicOfConversation func(string, string) (*slack.Channel, error) + SetTopicOfConversationContext func(context.Context, string, string) (*slack.Channel, error) + SetUltraRestricted func(string, string, string) error + SetUltraRestrictedContext func(context.Context, string, string, string) error + SetUserAsActive func() error + SetUserAsActiveContext func(context.Context) error + SetUserCustomStatus func(string, string, int64) error + SetUserCustomStatusContext func(context.Context, string, string, int64) error + SetUserPhoto func(string, slack.UserSetPhotoParams) error + SetUserPhotoContext func(context.Context, string, slack.UserSetPhotoParams) error + SetUserPresence func(string) error + SetUserPresenceContext func(context.Context, string) error + ShareFilePublicURL func(string) (*slack.File, []slack.Comment, *slack.Paging, error) + ShareFilePublicURLContext func(context.Context, string) (*slack.File, []slack.Comment, *slack.Paging, error) + StartRTM func() (*slack.Info, string, error) + StartRTMContext func(context.Context) (*slack.Info, string, error) + UnArchiveConversation func(string) error + UnArchiveConversationContext func(context.Context, string) error + UnarchiveChannel func(string) error + UnarchiveChannelContext func(context.Context, string) error + UnarchiveGroup func(string) error + UnarchiveGroupContext func(context.Context, string) error + UnfurlMessage func(string, string, map[string]slack.Attachment, ...slack.MsgOption) (string, string, string, error) + UnsetUserCustomStatus func() error + UnsetUserCustomStatusContext func(context.Context) error + UpdateMessage func(string, string, ...slack.MsgOption) (string, string, string, error) + UpdateMessageContext func(context.Context, string, string, ...slack.MsgOption) (string, string, string, error) + UpdateUserGroup func(slack.UserGroup) (slack.UserGroup, error) + UpdateUserGroupContext func(context.Context, slack.UserGroup) (slack.UserGroup, error) + UpdateUserGroupMembers func(string, string) (slack.UserGroup, error) + UpdateUserGroupMembersContext func(context.Context, string, string) (slack.UserGroup, error) + UploadFile func(slack.FileUploadParameters) (*slack.File, error) + UploadFileContext func(context.Context, slack.FileUploadParameters) (*slack.File, error) + type ScheduledTask struct + Schedule string + Task taskFunc + type SimpleStore map[string][]byte + func (s SimpleStore) Delete(key string) error + func (s SimpleStore) Get(key string, value interface{}) error + func (s SimpleStore) Put(key string, value interface{}) error + type Step struct + Handler func(exchange *Exchange) error + Message string + MsgHandler func(exchange *Exchange, event *slack.MessageEvent) (retry bool, err error) + Name string + type Store interface + Delete func(key string) error + Get func(key string, value interface{}) error + Put func(key string, value interface{}) error