cleanup warnings

This commit is contained in:
lyx0 2023-10-10 18:03:13 +02:00
parent 801853cdb3
commit dda26a8e49
4 changed files with 15 additions and 7 deletions

View file

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

View file

@ -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)

View file

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

View file

@ -81,6 +81,4 @@ func (u UploadModel) UpdateUploadURL(identifier, uploadURL string) {
return
}
}
return
}