Implement configurable topic change timer.
parent
081d354bab
commit
c8de797166
4
main.go
4
main.go
|
@ -56,6 +56,7 @@ func main() {
|
|||
var password string
|
||||
var timeout time.Duration
|
||||
var pingFreq time.Duration
|
||||
topicRefreshDelay := 30 * time.Second
|
||||
|
||||
var allowInvite bool
|
||||
|
||||
|
@ -80,6 +81,7 @@ func main() {
|
|||
|
||||
// football-data config
|
||||
kingpin.Flag("footballdata-key", "The API key to use to access the YouTube API.").StringVar(&authToken)
|
||||
kingpin.Flag("topic-refresh-delay", "The interval between topic updates. (This includes asking football-data for new information!)").DurationVar(&topicRefreshDelay)
|
||||
|
||||
// behavior config
|
||||
kingpin.Flag("allow-invite", "Determines whether the bot can be invited to other IRC channels.").BoolVar(&allowInvite)
|
||||
|
@ -675,7 +677,7 @@ func main() {
|
|||
for {
|
||||
// Wait a minute before refreshing
|
||||
select {
|
||||
case <-time.After(30 * time.Second):
|
||||
case <-time.After(topicRefreshDelay):
|
||||
case <-updateTopicsChan:
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue