fixed path resolution
This commit is contained in:
+3
-2
@@ -14,6 +14,7 @@ import (
|
||||
"time"
|
||||
"net"
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
@@ -143,11 +144,11 @@ func tw_process_message(rawmsg string) {
|
||||
|
||||
/* entry point */
|
||||
func twitch_run(config map[string]interface{}) {
|
||||
token_path := "auth/twitch-token.txt"
|
||||
token_path := filepath.Join(APP_ROOT_DIR, "auth", "twitch-token.txt")
|
||||
token, err := ioutil.ReadFile(token_path)
|
||||
token_err_msg := "[twitch] No Twitch token file provided or it is empty. "
|
||||
token_err_msg += "Please visit https://twitchapps.com/tmi/, generate a token there "
|
||||
token_err_msg += "and paste it into the auth/twitch-token.txt file!"
|
||||
token_err_msg += "and paste it into the " + token_path +" file!"
|
||||
if err != nil {
|
||||
log.Fatal(token_err_msg + "\nDetailed error: ", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user