Skip to content

Commit

Permalink
fixed the queue delete command (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenwiltink authored Aug 29, 2022
1 parent 25c70f9 commit 875ea6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/bot/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ var queueCommand = Command{
var queueDeleteCommand = Command{
Name: "queue-delete",
Function: func(bot *MusicBot, message Message) {
words := strings.Fields(message.Message)
// !music queue-delete #
if len(words) <= 2 {
parameter, cmdParamError := message.getCommandParameter()
if cmdParamError != nil {
bot.ReplyToMessage(message, "No queue item provided")
return
}

queueItem, err := strconv.Atoi(words[2])
queueItem, err := strconv.Atoi(parameter)
if err != nil {
bot.ReplyToMessage(message, "Invalid queue-item provided")
return
Expand Down

0 comments on commit 875ea6a

Please sign in to comment.