Implement configurable topic change timer.

master
Icedream 2018-06-15 00:09:02 +02:00
parent 081d354bab
commit c8de797166
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 3 additions and 1 deletions

View File

@ -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:
}