mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
cleanup warnings
This commit is contained in:
parent
801853cdb3
commit
dda26a8e49
|
@ -63,7 +63,10 @@ func (app *application) checkMessage(text string) (bool, string) {
|
|||
}
|
||||
|
||||
var responseObject banphraseResponse
|
||||
json.Unmarshal(body, &responseObject)
|
||||
if err := json.Unmarshal(body, &responseObject); err != nil {
|
||||
app.Log.Error(err)
|
||||
return true, "could not check banphrase api"
|
||||
}
|
||||
|
||||
// Bad Message
|
||||
//
|
||||
|
@ -144,7 +147,6 @@ func (app *application) Send(target, message string, msgContext twitch.PrivateMe
|
|||
|
||||
commandName := strings.ToLower(strings.SplitN(msgContext.Message, " ", 3)[0][2:])
|
||||
identifier := uuid.NewString()
|
||||
app.Log.Info("xd xd")
|
||||
go app.Models.SentMessagesLogs.Insert(target, message, commandName, msgContext.User.Name, msgContext.User.ID, msgContext.Message, identifier, msgContext.Raw)
|
||||
|
||||
// Since messages starting with `.` or `/` are used for special actions
|
||||
|
|
|
@ -65,8 +65,16 @@ func (app *application) CatboxUpload(target, fileName, identifier string, msg tw
|
|||
defer w.Close()
|
||||
defer m.Close()
|
||||
|
||||
m.WriteField("reqtype", "fileupload")
|
||||
m.WriteField("time", "24h")
|
||||
err := m.WriteField("reqtype", "fileupload")
|
||||
if err != nil {
|
||||
app.Send(target, fmt.Sprintf("Something went wrong FeelsBadMan: %q", err), msg)
|
||||
return
|
||||
}
|
||||
err = m.WriteField("time", "24h")
|
||||
if err != nil {
|
||||
app.Send(target, fmt.Sprintf("Something went wrong FeelsBadMan: %q", err), msg)
|
||||
return
|
||||
}
|
||||
part, err := m.CreateFormFile("fileToUpload", filepath.Base(file.Name()))
|
||||
if err != nil {
|
||||
app.Send(target, fmt.Sprintf("Something went wrong FeelsBadMan: %q", err), msg)
|
||||
|
|
|
@ -14,7 +14,7 @@ func (app *application) InitUser(login, twitchId string) {
|
|||
_, err := app.Models.Users.Check(twitchId)
|
||||
//app.Log.Error(err)
|
||||
if err != nil {
|
||||
app.Models.Users.Insert(login, twitchId)
|
||||
go app.Models.Users.Insert(login, twitchId)
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
@ -81,6 +81,4 @@ func (u UploadModel) UpdateUploadURL(identifier, uploadURL string) {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue