models

package
v0.0.0-...-3ba6e34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2018 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoMessage

type AutoMessage struct {
	ID                bson.ObjectId `bson:"_id,omitempty" json:"id"`
	ChannelID         string        `json:"channelID"`
	Message           string        `json:"message"`
	MessageLimit      int           `json:"messageLimit"`
	DurationLimit     time.Duration `json:"durationLimit"`
	MessageThreshold  int           `json:"messageThreshold"`
	DurationThreshold time.Time     `json:"durationThreshold"`
	Game              string        `json:"game"`
}

type AutoMessageHistory

type AutoMessageHistory struct {
	User          string        `valid:"required" json:"user"`
	UserID        string        `valid:"required" json:"userID"`
	Game          string        `json:"game"`
	Date          time.Time     `json:"date"`
	Message       string        `json:"message"`
	MessageLimit  int           `json:"messageLimit"`
	DurationLimit time.Duration `json:"durationLimit"`
}

type AutoMessageUpdate

type AutoMessageUpdate struct {
	ID            string
	User          string `valid:"required"`
	UserID        string `valid:"required"`
	ChannelID     string `valid:"required"`
	Game          string `json:"game"`
	Message       string `valid:"required" json:"message"`
	MessageLimit  int    `valid:"required" json:"messageLimit"`
	DurationLimit int    `valid:"required" json:"durationlimit"`
}

type AutoMessageWithHistory

type AutoMessageWithHistory struct {
	AutoMessage `bson:",inline"`
	History     []AutoMessageHistory `json:"history"`
}

type BanInfo

type BanInfo struct {
	User     string    `json:"user"`
	Duration int       `json:"duration"`
	Reason   string    `json:"reason"`
	Type     string    `json:"type"`
	Date     time.Time `json:"date"`
}

BanInfo describes info about person being banned

type Banme

type Banme struct {
	Enabled bool
}

Banme describes state of command Banme on chat

type ChannelBanRecord

type ChannelBanRecord struct {
	User      string    `json:"user"`
	UserID    string    `json:"userID"`
	BanLength int       `json:"banLength"`
	Date      time.Time `json:"date"`
}

type ChannelBans

type ChannelBans struct {
	ChannelID string             `json:"channelID"`
	Bans      []ChannelBanRecord `json:"bans"`
}

type ChannelInfo

type ChannelInfo struct {
	ChannelID       string       `json:"channelId"`
	Channel         string       `json:"channel"`
	StreamStatus    StreamStatus `json:"streamStatus"`
	Banme           Banme
	TwitchDJ        TwitchDJ    `json:"twitchDJ"`
	DubTrack        DubTrack    `json:"dubTrack"`
	VkGroupInfo     VkGroupInfo `json:"vkGroupInfo"`
	Mods            []string    `json:"mods"`
	OfflineCommands []string    `json:"offlinecommands"`
	OnlineCommands  []string    `json:"onlinecommands"`
	SubTrain        SubTrain    `json:"subTrain"`
	SubdayIsActive  bool        `json:"subdayIsActive"`
}

ChannelInfo describes all information about channel

func (ChannelInfo) GetCommands

func (channelInfo ChannelInfo) GetCommands() string

GetCommands Helper Command for mustashe

func (ChannelInfo) GetGamesHistory

func (chnanelInfo ChannelInfo) GetGamesHistory() string

func (ChannelInfo) GetIfUserIsMod

func (channelInfo ChannelInfo) GetIfUserIsMod(userID *string) bool

GetIfUserIsMod checks if user exist in internal mod array

func (ChannelInfo) GetStreamDuration

func (channelInfo ChannelInfo) GetStreamDuration() string

GetStreamDuration Helper Command for time for mustashe

type ChannelInfoForTemplate

type ChannelInfoForTemplate struct {
	ChannelInfo
	RandomInteger          int
	RandomIntegerIsMinimal bool
	RandomIntegerIsMaximal bool
	RandomIngegerIsZero    bool
	RandomString           string
	IsMod                  bool
	IsSub                  bool
	CommandBody            string
	CommandBodyIsEmpty     bool
}

type ChannelSelector

type ChannelSelector struct {
	ChannelID string
}

ChannelSelector is query selector for specific channel

type ChannelSongRequest

type ChannelSongRequest struct {
	ChannelID string
	Settings  ChannelSongRequestSettings
	Requests  []SongRequest
}

type ChannelSongRequestSettings

type ChannelSongRequestSettings struct {
	OnlySubs           bool
	PlaylistLength     int
	MaxVideoLength     int
	MaxRequestsPerUser int
	VideoViewLimit     int64
}

type ChannelUserSelector

type ChannelUserSelector struct {
	ChannelID string
	User      string
	UserID    string
}

ChannelSelector is query selector for specific channel

type ChannelUserWithID

type ChannelUserWithID struct {
	ChannelID string
	User      string
}

ChannelSelector is query selector for specific channel

type ChannelUsers

type ChannelUsers struct {
	ChannelID      string   `json:"channelID"`
	User           string   `json:"user"`
	UserID         string   `json:"userID"`
	KnownNicknames []string `json:"knownNicknames"`
}

type ChannelWithID

type ChannelWithID struct {
	Channel   string `json:"channel"`
	ChannelID string `json:"channelID"`
}

type ChatCommand

type ChatCommand struct {
	Command string
	Body    string
}

ChatCommand describes info about incoming chat command

type ChatMessage

type ChatMessage struct {
	MessageStruct `bson:",inline"`
	Channel       string
	ChannelID     string
	User          string
	UserID        string
	IsMod         bool
	IsSub         bool
	IsPrime       bool
}

ChatMessage describes processed twitch message with essential information on it

func (ChatMessage) GetCommand

func (chatMessage ChatMessage) GetCommand() (ChatCommand, bool)

GetCommand method checks if message starts from ! and returns body of command if it is command

type ChatMessageLog

type ChatMessageLog struct {
	User           string          `json:"user"`
	Channel        string          `json:"channel"`
	KnownNicknames []string        `json:"knownNicknames"`
	UserID         string          `json:"userID"`
	ChannelID      string          `json:"channelID"`
	Messages       []MessageStruct `json:"messages"`
	Bans           []BanInfo       `json:"bans"`
}

type Config

type Config struct {
	OauthKey     string `valid:"required"`
	BotUserName  string `valid:"required"`
	Channels     []string
	DbName       string `valid:"required"`
	ClientID     string `valid:"required"`
	ClientSecret string `valid:"required"`
	AppOauthURL  string `valid:"required"`
	AppURL       string `valid:"required"`
	Debug        bool
	VkClientKey  string
	YoutubeKey   string
}

Config defines nasfasf

type DubTrack

type DubTrack struct {
	ID      string
	Playing bool
	Track   string
}

DubTrack describes information about DubTrack service

type FollowerCursor

type FollowerCursor struct {
	ChannelID string
	Cursor    string
}

type FollowersList

type FollowersList struct {
	ChannelID string
	Followers []string
}

type GamesHistory

type GamesHistory []StreamStatusGameHistory

func (GamesHistory) Len

func (history GamesHistory) Len() int

func (GamesHistory) Less

func (history GamesHistory) Less(i, j int) bool

func (GamesHistory) ReturnHistory

func (history GamesHistory) ReturnHistory() string

func (GamesHistory) Swap

func (history GamesHistory) Swap(i, j int)

type HTTPSession

type HTTPSession struct {
	Username  string `valid:"required"`
	UserID    string `valid:"required"`
	Key       string `valid:"required"`
	AvatarURL string
}

HTTPSession defines nasfasf

type HttpError

type HttpError struct {
	Code    int         `json:"code"`
	Message interface{} `json:"message"`
}

type MessageStruct

type MessageStruct struct {
	Date        time.Time `json:"date"`
	Username    string    `json:"username"`
	MessageBody string    `json:"messageBody"`
	MessageType string    `json:"messageType"`
	BanLength   int       `json:"banLength"`
	BanReason   string    `json:"banReason"`
}

type OutgoingDebouncedMessage

type OutgoingDebouncedMessage struct {
	Message    OutgoingMessage
	Command    string
	RedirectTo string
}

OutgoingDebouncedMessage defines message that is send to a server with debounce abilities

type OutgoingMessage

type OutgoingMessage struct {
	Channel string
	Body    string
	User    string
}

OutgoingMessage defines message that is send to a server

type ResubInfo

type ResubInfo struct {
	Smiles     string
	ResubCount int
}

ResubInfo describes additional information for resub message

type Session

type Session struct {
	Username string
	AuthKey  string
}

Session is for session

type SongRequest

type SongRequest struct {
	User    string
	UserID  string
	Date    time.Time
	VideoID string
	Length  time.Duration
	Title   string
}

type StreamStatus

type StreamStatus struct {
	Online         bool
	Game           string       `bson:",omitempty"`
	Title          string       `bson:",omitempty"`
	Start          time.Time    `bson:",omitempty"`
	LastOnlineTime time.Time    `bson:",omitempty"`
	Viewers        int          `bson:",omitempty"`
	GamesHistory   GamesHistory `bson:",omitempty"`
}

StreamStatus Describes info about stream, when started, what game and title is, and if it is online

type StreamStatusGameHistory

type StreamStatusGameHistory struct {
	Game  string    `bson:",omitempty"`
	Start time.Time `bson:",omitempty"`
}

type SubAlert

type SubAlert struct {
	ChannelID    string `json:"channelID"`
	Enabled      bool   `json:"enabled"`
	SubAlertBody `bson:",inline"`
}

SubAlertdescribes subscription alert

type SubAlertBody

type SubAlertBody struct {
	FollowerMessage        string `json:"followerMessage"`
	SubPrimeMessage        string `json:"subPrimeMessage"`
	SubFiveMessage         string `json:"subFiveMessage"`
	SubTenMessage          string `json:"subTenMessage"`
	SubTwentyFiveMessage   string `json:"subTwentyFiveMessage"`
	ResubPrimeMessage      string `json:"resubPrimeMessage"`
	ResubFiveMessage       string `json:"resubFiveMessage"`
	ResubTenMessage        string `json:"resubTenMessage"`
	ResubTwentyFiveMessage string `json:"resubTwentyFiveMessage"`
	ResubPrimeSmile        string `json:"resubPrimeSmile"`
	ResubFiveSmile         string `json:"resubFiveSmile"`
	ResubTenSmile          string `json:"resubTenSmile"`
	ResubTwentyFiveSmile   string `json:"resubTwentyFiveSmile"`
}

type SubAlertHistory

type SubAlertHistory struct {
	User     string    `json:"user"`
	UserID   string    `json:"userID"`
	Date     time.Time `json:"date"`
	SubAlert `bson:",inline"`
}

SubAlertHistory describes all manipulations with subalerts

type SubAlertWithHistory

type SubAlertWithHistory struct {
	SubAlert `bson:",inline"`
	History  []SubAlertHistory `json:"history"`
}

type SubTrain

type SubTrain struct {
	Enabled              bool      `json:"enabled"`
	OnlyNewSubs          bool      `json:"onlyNewSubs"`
	ExpirationLimit      int       `json:"expirationLimit"`
	NotificationLimit    int       `json:"notificationLimit"`
	NotificationShown    bool      `json:"notificationShown"`
	ExpirationTime       time.Time `json:"expirationTime"`
	NotificationTime     time.Time `json:"notificationTime"`
	AppendTemplate       string    `json:"appendTemplate"`
	TimeoutTemplate      string    `json:"timeoutTemplate"`
	NotificationTemplate string    `json:"notificationTemplate"`
	CurrentStreak        int       `json:"сurrentStreak"`
	Users                []string  `json:"users"`
}

type Subday

type Subday struct {
	ID             bson.ObjectId          `bson:"_id,omitempty" json:"id"`
	ChannelID      string                 `json:"channelID"`
	IsActive       bool                   `json:"isActive"`
	SubsOnly       bool                   `json:"subsOnly"`
	Name           string                 `json:"name"`
	Date           time.Time              `json:"date"`
	Votes          []SubdayRecord         `json:"votes"`
	Winners        []SubdayRecord         `json:"winners"`
	WinnersHistory []SubdayWinnersHistory `json:"winnersHistory"`
}

type SubdayList

type SubdayList struct {
	ID        bson.ObjectId `bson:"_id,omitempty" json:"id"`
	ChannelID string        `json:"channelID"`
	IsActive  bool          `json:"isActive"`
	Name      string        `json:"name"`
	Date      time.Time     `json:"date"`
}

type SubdayNoWinners

type SubdayNoWinners struct {
	ID        bson.ObjectId  `bson:"_id,omitempty" json:"id"`
	ChannelID string         `json:"channelID"`
	IsActive  bool           `json:"isActive"`
	SubsOnly  bool           `json:"subsOnly"`
	Name      string         `json:"name"`
	Date      time.Time      `json:"date"`
	Votes     []SubdayRecord `json:"votes"`
}

type SubdayRecord

type SubdayRecord struct {
	User   string `json:"user"`
	UserID string `json:"userID"`
	Game   string `json:"game"`
}

type SubdayWinnersHistory

type SubdayWinnersHistory struct {
	Date    time.Time      `json:"date"`
	Winners []SubdayRecord `json:"winners"`
}

type SubscriptionInfo

type SubscriptionInfo struct {
	ID        bson.ObjectId `bson:"_id,omitempty" json:"id"`
	Count     int           `json:"count"`
	IsPrime   bool          `json:"isPrime"`
	User      string        `json:"user"`
	UserID    string        `json:"userID"`
	ChannelID string        `json:"channelID"`
	Date      time.Time     `json:"date"`
	SubPlan   string        `json:"subPlan"`
}

SubscriptionInfo shows how many t imes user is subscribed to a channel

type TemplateAliasSelector

type TemplateAliasSelector struct {
	ChannelID string
	AliasTo   string
}

TemplateAliasSelector is query selector for specific channel and command aliases

type TemplateHistory

type TemplateHistory struct {
	TemplateInfoBody `bson:",inline"`
	User             string    `json:"user"`
	UserID           string    `json:"userID"`
	Date             time.Time `json:"date"`
}

TemplateHistory describes history of chat command

type TemplateInfo

type TemplateInfo struct {
	ChannelID        string `json:"channelID"`
	CommandName      string `json:"commandName"`
	TemplateInfoBody `bson:",inline"`
}

TemplateInfo describes info about chat template WITHOUT history

type TemplateInfoBody

type TemplateInfoBody struct {
	ShowOnline        bool                      `json:"showOnline"`
	ShowOffline       bool                      `json:"showOffline"`
	PreventDebounce   bool                      `json:"preventDebounce"`
	PreventRedirect   bool                      `json:"preventRedirect"`
	OnlyPrivate       bool                      `json:"onlyPrivate"`
	AliasTo           string                    `json:"aliasTo"`
	Template          string                    `json:"template"`
	IntegerRandomizer TemplateIntegerRandomizer `json:"integerRandomizer"`
	StringRandomizer  TemplateStringRandomizer  `json:"stringRandomizer"`
}

type TemplateInfoWithHistory

type TemplateInfoWithHistory struct {
	TemplateInfo `bson:",inline"`
	History      []TemplateHistory `json:"history"`
}

type TemplateIntegerRandomizer

type TemplateIntegerRandomizer struct {
	Enabled      bool `json:"enabled"`
	TimeoutAfter bool `json:"timeoutAfter"`
	LowerLimit   int  `json:"lowerLimit"`
	UpperLimit   int  `json:"upperLimit"`
}

type TemplateSelector

type TemplateSelector struct {
	ChannelID   string
	CommandName string
}

TemplateSelector is query selector for specific channel and command without aliases

type TemplateStringRandomizer

type TemplateStringRandomizer struct {
	Enabled bool     `json:"enabled"`
	Strings []string `json:"strings"`
}

type TimerMessageHistory

type TimerMessageHistory struct {
	TimerMessageInfo `bson:",inline"`
	User             string
	Date             time.Time
}

TimerMessageHistory is history-item for TimerMessageInfo

type TimerMessageInfo

type TimerMessageInfo struct {
	ID                string
	Channel           string
	Period            int
	MessageThreshhold int
	Body              string
	LastRun           time.Time
}

TimerMessageInfo describes moobot-like automatic messages to chat

type TwitchDJ

type TwitchDJ struct {
	ID             string `json:"id"`
	Playing        bool   `json:"playing"`
	Track          string `json:"track"`
	NotifyOnChange bool   `json:"notifyOnChange"`
}

TwitchDJ describes information about twitchDJ service

type UserBits

type UserBits struct {
	User      string `json:"user"`
	UserID    string `json:"userID"`
	ChannelID string `json:"channelID"`
	Amount    int    `json:"amount"`
}

type UserBitsHistory

type UserBitsHistory struct {
	Change int       `json:"change"`
	Reason string    `json:"reason"`
	Date   time.Time `json:"date"`
}

type UserBitsWithHistory

type UserBitsWithHistory struct {
	UserBits `bson:",inline"`
	History  []UserBitsHistory `json:"history"`
}

type VkGroupInfo

type VkGroupInfo struct {
	GroupName       string `json:"groupName"`
	NotifyOnChange  bool   `json:"notifyOnChange"`
	LastMessageID   int    `json:"lastMessageID"`
	LastMessageURL  string `json:"lastMessageURL"`
	LastMessageBody string `json:"lastMessageBody"`
	LastMessageDate string `json:"lastMessageDate"`
}

type YTContentDetails

type YTContentDetails struct {
	Duration string `json:"duration"`
}

func (YTContentDetails) GetDuration

func (ytContentDetails YTContentDetails) GetDuration() (*time.Duration, error)

type YTItem

type YTItem struct {
	Snippet        YTSnippet        `json:"snippet"`
	ContentDetails YTContentDetails `json:"contentDetails"`
	Statistics     YTStatistics     `json:"statistics"`
}

type YTPageInfo

type YTPageInfo struct {
	TotalResults int `json:"totalResults"`
}

type YTSnippet

type YTSnippet struct {
	Title string `json:"title"`
}

type YTStatistics

type YTStatistics struct {
	ViewCount string `json:"viewCount"`
}

func (YTStatistics) GetViewCount

func (ytStatistics YTStatistics) GetViewCount() int64

type YoutubeVideo

type YoutubeVideo struct {
	PageInfo YTPageInfo `json:"pageInfo"`
	Items    []YTItem   `json:"items"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL