Skip to content

Commit

Permalink
Fix cleverbot api | Fixes #25
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Breuer committed Jan 22, 2017
1 parent 91629b7 commit 5defeb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions helpers/cleverbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"github.com/ugjka/cleverbot-go"
)

const API_ID = "Karen Discord-Bot <lukas.breuer@outlook.com> (https://meetkaren.xyz)"

// cleverbotSessions stores all cleverbot connections
var cleverbotSessions map[string]*cleverbot.Session

Expand All @@ -17,7 +19,7 @@ func CleverbotSend(session *discordgo.Session, channel string, message string) {
cleverbotSessions = make(map[string]*cleverbot.Session)
}

cleverbotSessions[channel] = cleverbot.New()
cleverbotSessions[channel] = cleverbot.New(API_ID)
}

response, err := cleverbotSessions[channel].Ask(message)
Expand All @@ -32,5 +34,5 @@ func CleverbotSend(session *discordgo.Session, channel string, message string) {

// CleverbotRefreshSession refreshes the cleverbot session for said channel
func CleverbotRefreshSession(channel string) {
cleverbotSessions[channel] = cleverbot.New()
cleverbotSessions[channel] = cleverbot.New(API_ID)
}

0 comments on commit 5defeb3

Please sign in to comment.