mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add way to delete commands
This commit is contained in:
parent
58ad0b3e20
commit
704a6a9470
|
@ -67,7 +67,6 @@ func (app *Application) GetCommand(name, username string) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (app *Application) EditCommandLevel(name, lvl string, message twitch.PrivateMessage) {
|
func (app *Application) EditCommandLevel(name, lvl string, message twitch.PrivateMessage) {
|
||||||
|
|
||||||
level, err := strconv.Atoi(lvl)
|
level, err := strconv.Atoi(lvl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.Logger.Error(err)
|
app.Logger.Error(err)
|
||||||
|
@ -87,3 +86,15 @@ func (app *Application) EditCommandLevel(name, lvl string, message twitch.Privat
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (app *Application) DeleteCommand(name string, message twitch.PrivateMessage) {
|
||||||
|
err := app.Models.Commands.Delete(name)
|
||||||
|
if err != nil {
|
||||||
|
common.Send(message.Channel, "Something went wrong FeelsBadMan", app.TwitchClient)
|
||||||
|
app.Logger.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
reply := fmt.Sprintf("Deleted command %s", name)
|
||||||
|
common.Send(message.Channel, reply, app.TwitchClient)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue