Change where config is saved
This commit is contained in:
1
chess.go
1
chess.go
@ -14,7 +14,6 @@ import (
|
|||||||
|
|
||||||
func chessCommand(m chat1.MsgSummary) {
|
func chessCommand(m chat1.MsgSummary) {
|
||||||
defer log.PanicSafe()
|
defer log.PanicSafe()
|
||||||
defer saveConfig()
|
|
||||||
convID := string(m.ConvID)
|
convID := string(m.ConvID)
|
||||||
parts := strings.Split(m.Content.Text.Body, " ")
|
parts := strings.Split(m.Content.Text.Body, " ")
|
||||||
if g, ok := config.Games[convID]; ok {
|
if g, ok := config.Games[convID]; ok {
|
||||||
|
|||||||
3
main.go
3
main.go
@ -26,6 +26,7 @@ var (
|
|||||||
|
|
||||||
func printChat(m chat1.MsgSummary) {
|
func printChat(m chat1.MsgSummary) {
|
||||||
defer log.PanicSafe()
|
defer log.PanicSafe()
|
||||||
|
defer saveConfig()
|
||||||
if m.Sender.Username == k.Username {
|
if m.Sender.Username == k.Username {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -40,7 +41,7 @@ func main() {
|
|||||||
loadConfig()
|
loadConfig()
|
||||||
fmt.Println("Starting log")
|
fmt.Println("Starting log")
|
||||||
log = loggy.NewLogger(config.LogOpts)
|
log = loggy.NewLogger(config.LogOpts)
|
||||||
fmt.Println("Log configured?")
|
fmt.Println("Log configured")
|
||||||
defer log.PanicSafe()
|
defer log.PanicSafe()
|
||||||
log.LogInfo("Logger configured")
|
log.LogInfo("Logger configured")
|
||||||
chat := printChat
|
chat := printChat
|
||||||
|
|||||||
Reference in New Issue
Block a user