Documentation
¶
Index ¶
- Variables
- func DecodeInventory(resp_body []byte, inv *Inventory) error
- func DeleteUserByName(db *sqlx.DB, username string) bool
- func GetViewer(name string)
- func HandleCommands(fields []string, e *irc.Event) (string, error)
- func HandleGetSteamID(fields []string, e *irc.Event) (string, error)
- func HandleIP(fields []string, e *irc.Event) (string, error)
- func HandleMVM(fields []string, e *irc.Event) (string, error)
- func HandleMVMLobby(fields []string, e *irc.Event) (string, error)
- func HandleMyProfile(fields []string, e *irc.Event) (string, error)
- func HandleMySteamID(fields []string, e *irc.Event) (string, error)
- func HandleProfile(fields []string, e *irc.Event) (string, error)
- func HandleQuit(fields []string, e *irc.Event) (string, error)
- func HandleSCM(fields []string, e *irc.Event) (string, error)
- func HandleSetSteamID(fields []string, e *irc.Event) (string, error)
- func HandleStartIP(fields []string, e *irc.Event) (string, error)
- func HandleStopIP(fields []string, e *irc.Event) (string, error)
- func HandleViewers(fields []string, e *irc.Event) (string, error)
- func New(config Config) (*irc.Connection, error)
- func NormalizeItemName(name string) string
- func PrettyPrint(i interface{})
- func SetSteamID(username string, steam_id SteamID) error
- func Shutdown()
- type Action
- type ActiveViewers
- type ApiPlayerSumResponse
- type ApiVanityResponse
- type AppData
- type BPCurrency
- type BPCurrencyBase
- type BPCurrencyContainer
- type BPCurrencyResponse
- type ChatMsg
- type Chatter
- type ChatterResponse
- type ChatterTypes
- type Config
- type Description
- type Detail
- type EmotesContainer
- type EmotesImage
- type EmotesResp
- type EntryList
- type IRCHandlerFunc
- type IRCMessage
- type Inventory
- type Item
- type MarketAction
- type MarketPrice
- type MvMTour
- type PlayerInfo
- type Players
- type SteamID
- type Tag
- type User
- type Vanity
- type Viewer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InvalidArguments = errors.New("Incomplete arguments supplied") InvalidResponse = errors.New("Invalid response from remote") InternalError = errors.New("Internal error processing request") )
View Source
var ( LastGameIP = "*" UpdateGameData = true )
View Source
var (
SqlDB *sqlx.DB
)
Functions ¶
func DecodeInventory ¶
func HandleCommands ¶
func HandleGetSteamID ¶
func HandleMVMLobby ¶
func HandleMyProfile ¶
func HandleMySteamID ¶
func HandleProfile ¶
func HandleQuit ¶
func HandleSetSteamID ¶
func HandleStartIP ¶
func HandleStopIP ¶
func HandleViewers ¶
func NormalizeItemName ¶
func PrettyPrint ¶
func PrettyPrint(i interface{})
func SetSteamID ¶
Types ¶
type ActiveViewers ¶
type ActiveViewers struct {
// contains filtered or unexported fields
}
func (*ActiveViewers) Add ¶
func (av *ActiveViewers) Add(viewer *Viewer) bool
type ApiPlayerSumResponse ¶
type ApiPlayerSumResponse struct {
Response Players `json:"response"`
}
type ApiVanityResponse ¶
type ApiVanityResponse struct {
Response Vanity `json:"response"`
}
type BPCurrency ¶
type BPCurrencyBase ¶
type BPCurrencyBase struct {
Success int `json:"success"`
Currencies map[string]BPCurrencyContainer `json:"currencies"`
Name string `json:"name"`
URL string `json:"url"`
}
type BPCurrencyContainer ¶
type BPCurrencyContainer struct {
Quality int `json:"quality"`
PriceIndex int `json:"priceindex"`
Single string `json:"single"`
Plural string `json:"plural"`
Round int `json:"round"`
Blanket int `json:"blanket"`
Craftable string `json:"craftable"`
Tradable string `json:"tradable"`
DefIndex int `json:"defindex"`
Price BPCurrency `json:"price"`
}
type BPCurrencyResponse ¶
type BPCurrencyResponse struct {
Response BPCurrencyBase `json:"response"`
}
type ChatMsg ¶
type ChatMsg struct {
MessageID int `db:message_id`
UserID int `db:user_id`
Message string `db:message`
Emotes int `db:emotes`
CreatedAt time.Time `db:created_at`
}
func NewChatMsg ¶
type ChatterResponse ¶
type ChatterResponse struct {
ChatterCount int `json:"chatter_count"`
Chatters ChatterTypes `json:"chatters"`
}
func Chatters ¶
func Chatters(channel string) (*ChatterResponse, error)
func (*ChatterResponse) Count ¶
func (c *ChatterResponse) Count() int
type ChatterTypes ¶
type Config ¶
type Config struct {
// The Twitch IRC server, shouldn't need to change this
Server string
// Twitch username
Name string
// Twitch oauth IRC key
// See: http://www.twitchapps.com/tmi/
Password string
// Steam API Key
// See: http://steamcommunity.com/dev/apikey
ApiKey string
// Streamers steam ID, used as defaults for some commands
SteamID string
// Join these channels automatically
AutoJoin []string
// Send error and debugging messages to this channel
// You probably want to use a different channel from your main
DebugChannel string
// Print callback handler debug info to the console
VerboseCallbackHandler bool
// Print debug irc info to the console
Debug bool
// Database file path to use
Database string
// Prefix for IRC commands, "!" default
Prefix string
}
var ( Conf Config Handlers = map[string]IRCHandlerFunc{ "viewers": HandleViewers, "steamid": HandleGetSteamID, "setsteamid": HandleSetSteamID, "mysteamid": HandleMySteamID, "profile": HandleProfile, "myprofile": HandleMyProfile, "commands": HandleCommands, "mvm": HandleMVM, "mymvm": HandleMVM, "ip": HandleIP, "startip": HandleStartIP, "stopip": HandleStopIP, "quit": HandleQuit, "mvmlobby": HandleMVMLobby, "scm": HandleSCM, } )
func (*Config) ChannelName ¶
type Description ¶
type Detail ¶
type Detail struct {
Appid string `json:"appid"`
Classid string `json:"classid"`
Instanceid string `json:"instanceid"`
Icon_url string `json:"icon_url"`
Icon_url_large string `json:"icon_url_large"`
Icon_drag_url string `json:"icon_drag_url"`
Name string `json:"name"`
Market_hash_name string `json:"market_hash_name"`
Market_name string `json:"market_name"`
Name_colour string `json:"name_color"`
Background_color string `json:"background_color"`
Type string `json:"type"`
Tradable uint64 `json:"tradable"`
Marketable uint64 `json:"marketable"`
Commodity uint64 `json:"commodity"`
Market_tradable_restriction string `json:"market_tradable_restriction"`
Market_marketable_restriction string `json:"market_marketable_restriction"`
Descriptions []Description `json:"descriptions"`
Actions []Action `json:"actions"`
MarketActions []MarketAction `json:"market_actions"`
Tags []Tag `json:"-"`
AppData AppData `json:"app_data"`
}
type EmotesContainer ¶
type EmotesContainer struct {
Regex string `json:"regex"`
Images []EmotesImage `json:"images"`
}
type EmotesImage ¶
type EmotesResp ¶
type EmotesResp struct {
Emoticons []EmotesContainer `json:"emoticons"`
// contains filtered or unexported fields
}
func FetchEmotes ¶
func FetchEmotes() (*EmotesResp, error)
type IRCHandlerFunc ¶
type IRCMessage ¶
type Inventory ¶
type Inventory struct {
Success bool `json:"success"`
Inventory map[string]Item `json:"rgInventory"`
Descriptions map[string]Detail `json:"rgDescriptions"`
More bool `json:"more"`
More_start bool `json:"more_start"`
}
func FetchInventory ¶
func (*Inventory) FindMVMData ¶
type MarketAction ¶
type MarketPrice ¶
type MarketPrice struct {
Success bool `json:"success"`
Name string
LowestPrice string `json:"lowest_price"`
Volume int `json:"volume,string"`
MedianPrice string `json:"median_price"`
}
func GetPrice ¶
func GetPrice(hash_name string) (*MarketPrice, error)
type MvMTour ¶
func (*MvMTour) AddCompleted ¶
type PlayerInfo ¶
type PlayerInfo struct {
SteamID SteamID `json:"steamid"`
CommunityVisibilityState int `json:"communityvisibilitystate"`
ProfileState int `json:"profilestate"`
PersonaName string `json:"personaname"`
LastLogoff int `json:"lastlogoff"`
CommentPermission int `json:"commentpermission"`
ProfileURL string `json:"profileurl"`
Avatar string `json:"avatar"`
AvatarMedium string `json:"avatarmedium"`
AvatarFull string `json:"avatarfull"`
PersonaState int `json:"personastate"`
RealName string `json:"realname"`
PrimaryClanID string `json:"primaryclanid"`
TimeCreated int `json:"timecreated"`
PersonaStateFlags int `json:"personastateflags"`
GameServerIP string `json:"gameserverip"`
GameExtraInfo string `json:"gameextrainfo"`
GameID string `json:"gameid"`
}
func GetPlayerInfo ¶
func GetPlayerInfo(api_key string, steam_id SteamID) (*PlayerInfo, error)
type Players ¶
type Players struct {
Players []PlayerInfo `json:"players"`
}
type SteamID ¶
type SteamID string
func GetSteamID ¶
func NewSteamID ¶
func ResolveVanity ¶
func (SteamID) MVMLobbyURL ¶
func (SteamID) ProfileURL ¶
type User ¶
type User struct {
UserID int `db:user_id`
Username string `db:username`
SteamID string `db:steamid`
CreatedAt time.Time `db:created_at`
}
func GetOrCreateUser ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.