Documentation
¶
Index ¶
- Variables
- func AddInstallation(installation Installation) error
- func AddUser(user User) error
- func Connect()
- func GetConversationLastPostedOn(conversationID, userID string) time.Time
- func SetConversationLastPostedOn(conversationID, userID string, lastPostedOn time.Time) error
- func SetReplyMode(userID string, mode ReplyMode) error
- func SetUserDates(start, end time.Time, userID string) error
- func SetUserMessage(userID string, message string) error
- func SetUserWhitelist(userID string, whitelist []string) error
- func ToggleReplyActive(userID string)
- type Conversation
- type Installation
- type ReplyMode
- type User
- type UserReply
Constants ¶
This section is empty.
Variables ¶
var DB *mongo.Client
DB is the Mongo database
Functions ¶
func AddInstallation ¶
func AddInstallation(installation Installation) error
AddInstallation adds an installation to the database
func GetConversationLastPostedOn ¶
GetConversationLastPostedOn gets the Time that the conversation was last autoreplied to.
func SetConversationLastPostedOn ¶
SetConversationLastPostedOn sets the Time above ^
func SetReplyMode ¶
SetReplyMode sets a user's reply mode
func SetUserDates ¶
SetUserDates sets a user's start/end dates
func SetUserMessage ¶
SetUserMessage sets a users message
func SetUserWhitelist ¶
SetUserWhitelist sets a user's whitelist
func ToggleReplyActive ¶
func ToggleReplyActive(userID string)
ToggleReplyActive toggle's the activity of a user's autoreply
Types ¶
type Conversation ¶
type Conversation struct { UserID string `bson:"user_id"` ConversationID string `bson:"conversation_id"` LastPostedOn int64 `bson:"last_posted_on"` }
Conversation represents a single DM or channel.
type Installation ¶
type Installation struct { TeamID string `bson:"team_id"` Scopes []string `bson:"scopes"` Token string `bson:"token"` BotID string `bson:"bot_id"` }
Installation represents an app installation
func GetInstallation ¶
func GetInstallation(teamID string) (*Installation, error)
GetInstallation gets an installation
type User ¶
type User struct { Token string `bson:"token"` UserID string `bson:"user_id"` Reply UserReply `bson:"reply"` Scopes []string `bson:"scopes"` TeamID string `bson:"team_id"` }
User represents a DB user.
func (User) ReplyShouldSend ¶
ReplyShouldSend figures out whether or not the configured autoreply should be sent