Documentation ¶
Index ¶
- func AllCryptos(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func BitcoinTicker(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func Build(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func Checkout(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func Define(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func EthTicker(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func Handle(key string, h messagerouter.MessageHandler)
- func Init(msgr *messagerouter.MessageRouter)
- func Insult(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func MemeGenerator(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func Ping(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func Restart(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func Weather(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- type BokBok
- func (bkbk *BokBok) Chain(username string) *Chain
- func (bkbk *BokBok) MaybeRespond(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func (bkbk *BokBok) NewChain(username string) *Chain
- func (bkbk *BokBok) ProcessMessage(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func (bkbk *BokBok) Respond(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter)
- func (bkbk *BokBok) RespondHere(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
- func (bkbk *BokBok) SaveChains(chains ...*Chain) error
- func (bkbk *BokBok) YesNo() bool
- type Chain
- type Definition
- type Portfolio
- type Prefix
- type PuddleErrWriter
- type PuddleWriter
- type Ticker
- type Tickers
- type WTEMP_amoc
- type WTEMP_copyright
- type WTEMP_disclaimer
- type WTEMP_element
- type WTEMP_identifier
- type WTEMP_issue_time_local
- type WTEMP_issue_time_utc
- type WTEMP_level
- type WTEMP_observations
- type WTEMP_office
- type WTEMP_period
- type WTEMP_phase
- type WTEMP_product
- type WTEMP_product_type
- type WTEMP_region
- type WTEMP_root
- type WTEMP_sender
- type WTEMP_sent_time
- type WTEMP_service
- type WTEMP_source
- type WTEMP_station
- type WTEMP_status
- type W_amoc
- type W_area
- type W_copyright
- type W_disclaimer
- type W_expiry_time
- type W_forecast
- type W_forecast_period
- type W_identifier
- type W_issue_time_local
- type W_issue_time_utc
- type W_next_routine_issue_time_local
- type W_next_routine_issue_time_utc
- type W_office
- type W_p
- type W_phase
- type W_product
- type W_product_type
- type W_region
- type W_root
- type W_sender
- type W_sent_time
- type W_service
- type W_source
- type W_status
- type W_sub_service
- type W_text
- type W_validity_bgn_time_local
- type W_validity_end_time_local
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllCryptos ¶
func AllCryptos(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
AllCryptos wraps allCryptos with results
func BitcoinTicker ¶
func BitcoinTicker(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
BitcoinTicker will return a string containing the current rate in USD
func Build ¶
func Build(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
Build will pull the latest git master and rebuild. It will then restart puddlebot Syntax: `!build <branch-name>` Example: `!build master`
func Checkout ¶
func Checkout(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
Checkout pulls & checks out a branch
func Define ¶
func Define(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
Define fetches the dictionary definition of a word
func EthTicker ¶
func EthTicker(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
EthTicker will return a string containing the current rate in USD
func Handle ¶
func Handle(key string, h messagerouter.MessageHandler)
Handle stores commands before initialisation
func Insult ¶
func Insult(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
Insult will insult someone
func MemeGenerator ¶
func MemeGenerator(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
MemeGenerator will post the latest meme from imgur meme gallery
func Ping ¶
func Ping(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
Ping responds to !ping with a pong!
func Restart ¶
func Restart(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
Restart restarts Puddlebot.
func Weather ¶
func Weather(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
Weather prints out the current temperature & forecast. Usage: !weather
Types ¶
type BokBok ¶
type BokBok struct { Channel string // contains filtered or unexported fields }
BokBok is a smart chat bot
func (*BokBok) Chain ¶
Chain retreives chain from bkbk.db. Creates username bucket if it doesn't exist
func (*BokBok) MaybeRespond ¶
func (bkbk *BokBok) MaybeRespond(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
MaybeRespond might respond, or it might not, for top kek
func (*BokBok) ProcessMessage ¶
func (bkbk *BokBok) ProcessMessage(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
Processes Message builds or amends the Markov Chain for "all" and the individual user
func (*BokBok) Respond ¶
func (bkbk *BokBok) Respond(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter)
Respond reponds to message
func (*BokBok) RespondHere ¶
func (bkbk *BokBok) RespondHere(cr *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
RespondHere allows the user to apply a channel to respond to Triggered by !bokbok <channel>
func (*BokBok) SaveChains ¶
SaveChains saves chains to the database
type Chain ¶
Chain contains a map ("chain") of prefixes to a list of suffixes. A prefix is a string of prefixLen words joined with spaces. A suffix is a single word. A prefix can have multiple suffixes.
func (*Chain) Build ¶
Build reads text from the provided Reader and parses it into prefixes and suffixes that are stored in Chain.
type Definition ¶
type Definition struct { Metadata struct { Provider string `json:"provider"` } `json:"metadata"` Results []struct { ID string `json:"id"` Language string `json:"language"` LexicalEntries []struct { Entries []struct { Etymologies []string `json:"etymologies"` GrammaticalFeatures []struct { Text string `json:"text"` Type string `json:"type"` } `json:"grammaticalFeatures"` HomographNumber string `json:"homographNumber"` Senses []struct { Definitions []string `json:"definitions"` Examples []struct { Text string `json:"text"` } `json:"examples,omitempty"` ID string `json:"id"` Domains []string `json:"domains,omitempty"` } `json:"senses"` } `json:"entries"` Language string `json:"language"` LexicalCategory string `json:"lexicalCategory"` Pronunciations []struct { AudioFile string `json:"audioFile"` Dialects []string `json:"dialects"` PhoneticNotation string `json:"phoneticNotation"` PhoneticSpelling string `json:"phoneticSpelling"` } `json:"pronunciations"` Text string `json:"text"` } `json:"lexicalEntries"` Type string `json:"type"` Word string `json:"word"` } `json:"results"` }
type Portfolio ¶
type Portfolio struct{}
Portfolio is the command handling portfolio commands
func (*Portfolio) PortfolioGet ¶
func (p *Portfolio) PortfolioGet(c *cli.Context, r *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
PortfolioGet gets the current user's portfolio
func (*Portfolio) PortfolioRegister ¶
func (p *Portfolio) PortfolioRegister(c *cli.Context, r *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
PortfolioRegister adds the current user to the DB (not implemented)
func (*Portfolio) Run ¶
func (p *Portfolio) Run(r *messagerouter.CommandRequest, w messagerouter.ResponseWriter) error
Run will return a string containing the current rate in USD
type Prefix ¶
type Prefix []string
Prefix is a Markov chain prefix of one or more words.
type PuddleErrWriter ¶
type PuddleErrWriter struct {
// contains filtered or unexported fields
}
PuddleErrWriter implements io.Writer
type PuddleWriter ¶
type PuddleWriter struct {
// contains filtered or unexported fields
}
PuddleWriter implements io.Writer
type Ticker ¶
type Ticker struct { ID string `json:"id"` Name string `json:"name"` Symbol string `json:"symbol"` Rank string `json:"rank"` PriceUsd string `json:"price_usd"` PriceBtc string `json:"price_btc"` Two4HVolumeUsd string `json:"24h_volume_usd"` MarketCapUsd string `json:"market_cap_usd"` AvailableSupply string `json:"available_supply"` TotalSupply string `json:"total_supply"` PercentChange1H string `json:"percent_change_1h"` PercentChange24H string `json:"percent_change_24h"` PercentChange7D string `json:"percent_change_7d"` LastUpdated string `json:"last_updated"` }
Ticker contains all the data for a single crypto
type Tickers ¶
type Tickers []*Ticker
Tickers contain a slice of Ticker
type WTEMP_amoc ¶
type WTEMP_amoc struct { WTEMP_identifier *WTEMP_identifier `xml:" identifier,omitempty" json:"identifier,omitempty"` WTEMP_issue_time_local *WTEMP_issue_time_local `xml:" issue-time-local,omitempty" json:"issue-time-local,omitempty"` WTEMP_issue_time_utc *WTEMP_issue_time_utc `xml:" issue-time-utc,omitempty" json:"issue-time-utc,omitempty"` WTEMP_phase *WTEMP_phase `xml:" phase,omitempty" json:"phase,omitempty"` WTEMP_product_type *WTEMP_product_type `xml:" product-type,omitempty" json:"product-type,omitempty"` WTEMP_sent_time *WTEMP_sent_time `xml:" sent-time,omitempty" json:"sent-time,omitempty"` WTEMP_service *WTEMP_service `xml:" service,omitempty" json:"service,omitempty"` WTEMP_source *WTEMP_source `xml:" source,omitempty" json:"source,omitempty"` WTEMP_status *WTEMP_status `xml:" status,omitempty" json:"status,omitempty"` }
type WTEMP_copyright ¶
type WTEMP_copyright struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_disclaimer ¶
type WTEMP_disclaimer struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_element ¶
type WTEMP_element struct { Attr_duration string `xml:" duration,attr" json:",omitempty"` Attr_end_time_local string `xml:" end-time-local,attr" json:",omitempty"` Attr_end_time_utc string `xml:" end-time-utc,attr" json:",omitempty"` Attr_instance string `xml:" instance,attr" json:",omitempty"` Attr_start_time_local string `xml:" start-time-local,attr" json:",omitempty"` Attr_start_time_utc string `xml:" start-time-utc,attr" json:",omitempty"` Attr_time_local string `xml:" time-local,attr" json:",omitempty"` Attr_time_utc string `xml:" time-utc,attr" json:",omitempty"` Attr_type string `xml:" type,attr" json:",omitempty"` Attr_units string `xml:" units,attr" json:",omitempty"` Text string `xml:",chardata" json:",omitempty"` }
type WTEMP_identifier ¶
type WTEMP_identifier struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_issue_time_local ¶
type WTEMP_issue_time_utc ¶
type WTEMP_issue_time_utc struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_level ¶
type WTEMP_level struct { Attr_index string `xml:" index,attr" json:",omitempty"` Attr_type string `xml:" type,attr" json:",omitempty"` WTEMP_element []*WTEMP_element `xml:" element,omitempty" json:"element,omitempty"` }
type WTEMP_observations ¶
type WTEMP_observations struct {
WTEMP_station []*WTEMP_station `xml:" station,omitempty" json:"station,omitempty"`
}
type WTEMP_office ¶
type WTEMP_office struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_period ¶
type WTEMP_period struct { Attr_index string `xml:" index,attr" json:",omitempty"` Attr_time_local string `xml:" time-local,attr" json:",omitempty"` Attr_time_utc string `xml:" time-utc,attr" json:",omitempty"` Attr_wind_src string `xml:" wind-src,attr" json:",omitempty"` WTEMP_level *WTEMP_level `xml:" level,omitempty" json:"level,omitempty"` }
type WTEMP_phase ¶
type WTEMP_phase struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_product ¶
type WTEMP_product struct { Attr_xsi_noNamespaceSchemaLocation string `xml:"http://www.w3.org/2001/XMLSchema-instance noNamespaceSchemaLocation,attr" json:",omitempty"` Attr_version string `xml:" version,attr" json:",omitempty"` Attr_xsi string `xml:"xmlns xsi,attr" json:",omitempty"` WTEMP_amoc *WTEMP_amoc `xml:" amoc,omitempty" json:"amoc,omitempty"` WTEMP_observations *WTEMP_observations `xml:" observations,omitempty" json:"observations,omitempty"` }
type WTEMP_product_type ¶
type WTEMP_product_type struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_region ¶
type WTEMP_region struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_root ¶
type WTEMP_root struct {
WTEMP_product *WTEMP_product `xml:" product,omitempty" json:"product,omitempty"`
}
type WTEMP_sender ¶
type WTEMP_sender struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_sent_time ¶
type WTEMP_sent_time struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_service ¶
type WTEMP_service struct {
Text string `xml:",chardata" json:",omitempty"`
}
type WTEMP_source ¶
type WTEMP_source struct { WTEMP_copyright *WTEMP_copyright `xml:" copyright,omitempty" json:"copyright,omitempty"` WTEMP_disclaimer *WTEMP_disclaimer `xml:" disclaimer,omitempty" json:"disclaimer,omitempty"` WTEMP_office *WTEMP_office `xml:" office,omitempty" json:"office,omitempty"` WTEMP_region *WTEMP_region `xml:" region,omitempty" json:"region,omitempty"` WTEMP_sender *WTEMP_sender `xml:" sender,omitempty" json:"sender,omitempty"` }
type WTEMP_station ¶
type WTEMP_station struct { Attr_bom_id string `xml:" bom-id,attr" json:",omitempty"` Attr_description string `xml:" description,attr" json:",omitempty"` Attr_forecast_district_id string `xml:" forecast-district-id,attr" json:",omitempty"` Attr_lat string `xml:" lat,attr" json:",omitempty"` Attr_lon string `xml:" lon,attr" json:",omitempty"` Attr_stn_height string `xml:" stn-height,attr" json:",omitempty"` Attr_stn_name string `xml:" stn-name,attr" json:",omitempty"` Attr_type string `xml:" type,attr" json:",omitempty"` Attr_tz string `xml:" tz,attr" json:",omitempty"` Attr_wmo_id string `xml:" wmo-id,attr" json:",omitempty"` WTEMP_period *WTEMP_period `xml:" period,omitempty" json:"period,omitempty"` }
type WTEMP_status ¶
type WTEMP_status struct {
Text string `xml:",chardata" json:",omitempty"`
}
type W_amoc ¶
type W_amoc struct { W_expiry_time *W_expiry_time `xml:" expiry-time,omitempty" json:"expiry-time,omitempty"` W_identifier *W_identifier `xml:" identifier,omitempty" json:"identifier,omitempty"` W_issue_time_local *W_issue_time_local `xml:" issue-time-local,omitempty" json:"issue-time-local,omitempty"` W_issue_time_utc *W_issue_time_utc `xml:" issue-time-utc,omitempty" json:"issue-time-utc,omitempty"` W_next_routine_issue_time_local *W_next_routine_issue_time_local `xml:" next-routine-issue-time-local,omitempty" json:"next-routine-issue-time-local,omitempty"` W_next_routine_issue_time_utc *W_next_routine_issue_time_utc `xml:" next-routine-issue-time-utc,omitempty" json:"next-routine-issue-time-utc,omitempty"` W_phase *W_phase `xml:" phase,omitempty" json:"phase,omitempty"` W_product_type *W_product_type `xml:" product-type,omitempty" json:"product-type,omitempty"` W_sent_time *W_sent_time `xml:" sent-time,omitempty" json:"sent-time,omitempty"` W_service *W_service `xml:" service,omitempty" json:"service,omitempty"` W_source *W_source `xml:" source,omitempty" json:"source,omitempty"` W_status *W_status `xml:" status,omitempty" json:"status,omitempty"` W_sub_service *W_sub_service `xml:" sub-service,omitempty" json:"sub-service,omitempty"` W_validity_bgn_time_local *W_validity_bgn_time_local `xml:" validity-bgn-time-local,omitempty" json:"validity-bgn-time-local,omitempty"` W_validity_end_time_local *W_validity_end_time_local `xml:" validity-end-time-local,omitempty" json:"validity-end-time-local,omitempty"` }
type W_area ¶
type W_area struct { Attr_aac string `xml:" aac,attr" json:",omitempty"` Attr_description string `xml:" description,attr" json:",omitempty"` Attr_parent_aac string `xml:" parent-aac,attr" json:",omitempty"` Attr_type string `xml:" type,attr" json:",omitempty"` W_forecast_period []*W_forecast_period `xml:" forecast-period,omitempty" json:"forecast-period,omitempty"` }
type W_copyright ¶
type W_copyright struct {
Text string `xml:",chardata" json:",omitempty"`
}
type W_disclaimer ¶
type W_disclaimer struct {
Text string `xml:",chardata" json:",omitempty"`
}
type W_expiry_time ¶
type W_expiry_time struct {
Text string `xml:",chardata" json:",omitempty"`
}
type W_forecast ¶
type W_forecast struct {
W_area []*W_area `xml:" area,omitempty" json:"area,omitempty"`
}
type W_forecast_period ¶
type W_forecast_period struct { Attr_end_time_local string `xml:" end-time-local,attr" json:",omitempty"` Attr_end_time_utc string `xml:" end-time-utc,attr" json:",omitempty"` Attr_index string `xml:" index,attr" json:",omitempty"` Attr_start_time_local string `xml:" start-time-local,attr" json:",omitempty"` Attr_start_time_utc string `xml:" start-time-utc,attr" json:",omitempty"` W_text []*W_text `xml:" text,omitempty" json:"text,omitempty"` }
type W_identifier ¶
type W_identifier struct {
Text string `xml:",chardata" json:",omitempty"`
}
type W_issue_time_local ¶
type W_issue_time_utc ¶
type W_issue_time_utc struct {
Text string `xml:",chardata" json:",omitempty"`
}
type W_next_routine_issue_time_utc ¶
type W_next_routine_issue_time_utc struct {
Text string `xml:",chardata" json:",omitempty"`
}
type W_product ¶
type W_product struct { Attr_xsi_noNamespaceSchemaLocation string `xml:"http://www.w3.org/2001/XMLSchema-instance noNamespaceSchemaLocation,attr" json:",omitempty"` Attr_version string `xml:" version,attr" json:",omitempty"` Attr_xsi string `xml:"xmlns xsi,attr" json:",omitempty"` W_amoc *W_amoc `xml:" amoc,omitempty" json:"amoc,omitempty"` W_forecast *W_forecast `xml:" forecast,omitempty" json:"forecast,omitempty"` }
type W_product_type ¶
type W_product_type struct {
Text string `xml:",chardata" json:",omitempty"`
}
type W_root ¶
type W_root struct {
W_product *W_product `xml:" product,omitempty" json:"product,omitempty"`
}
type W_sent_time ¶
type W_sent_time struct {
Text string `xml:",chardata" json:",omitempty"`
}
type W_source ¶
type W_source struct { W_copyright *W_copyright `xml:" copyright,omitempty" json:"copyright,omitempty"` W_disclaimer *W_disclaimer `xml:" disclaimer,omitempty" json:"disclaimer,omitempty"` W_office *W_office `xml:" office,omitempty" json:"office,omitempty"` W_region *W_region `xml:" region,omitempty" json:"region,omitempty"` W_sender *W_sender `xml:" sender,omitempty" json:"sender,omitempty"` }
type W_sub_service ¶
type W_sub_service struct {
Text string `xml:",chardata" json:",omitempty"`
}