added success message

This commit is contained in:
DutchEllie 2021-05-18 12:49:30 +02:00
parent 3e4f3efa12
commit 6d79e8d9a0
2 changed files with 28 additions and 2 deletions

View File

@ -26,7 +26,15 @@ func (app *application) addWord(s *discordgo.Session, m *discordgo.MessageCreate
return
}
app.updateAllBadWords()
err = app.updateAllBadWords()
if err != nil {
app.unknownError(err, s, true, m.ChannelID)
return
}
app.successMessage(s, m)
}
func (app *application) removeWord(s *discordgo.Session, m *discordgo.MessageCreate, splitCommand []string) {
@ -53,7 +61,13 @@ func (app *application) removeWord(s *discordgo.Session, m *discordgo.MessageCre
return
}
app.updateAllBadWords()
err = app.updateAllBadWords()
if err != nil {
app.unknownError(err, s, true, m.ChannelID)
return
}
app.successMessage(s, m)
}
func (app *application) addAdmin(s *discordgo.Session, m *discordgo.MessageCreate, splitCommand []string) {
@ -100,6 +114,8 @@ func (app *application) addAdmin(s *discordgo.Session, m *discordgo.MessageCreat
return
}
app.successMessage(s, m)
}
func (app *application) removeAdmin(s *discordgo.Session, m *discordgo.MessageCreate, splitCommand []string) {
@ -146,4 +162,6 @@ func (app *application) removeAdmin(s *discordgo.Session, m *discordgo.MessageCr
return
}
app.successMessage(s, m)
}

View File

@ -227,4 +227,12 @@ func (app *application) contextLength(splitCommand []string) (error) {
return errors.New("not enough context")
}
return nil
}
func (app *application) successMessage(s *discordgo.Session, m *discordgo.MessageCreate) {
_, err := s.ChannelMessageSend(m.ChannelID, "Success!")
if err != nil {
app.unknownError(err, s, true, m.ChannelID)
return
}
}