-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
83 additions
and
388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,4 +54,4 @@ public void doCommand(CommandEvent event) | |
}); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,5 @@ protected void execute(CommandEvent event) | |
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ public DefaultlistCmd(Bot bot) | |
this.arguments = "<playlistname|NONE>"; | ||
this.guildOnly = true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.jagrosh.jmusicbot.commands.owner; | ||
|
||
import java.io.IOException; | ||
|
||
import com.jagrosh.jmusicbot.Bot; | ||
import com.jagrosh.jmusicbot.commands.OwnerCommand; | ||
|
||
public class DeletelistCmd extends OwnerCommand | ||
{ | ||
|
||
public DeletelistCmd(Bot bot) | ||
{ | ||
this.bot = bot; | ||
this.name = "delete"; | ||
this.aliases = new String[]{"remove"}; | ||
this.help = "deletes an existing playlist"; | ||
this.arguments = "<name>"; | ||
this.guildOnly = false; | ||
} | ||
|
||
@Override | ||
protected void execute(CommandEvent event) | ||
{ | ||
String pname = event.getArgs().replaceAll("\\s+", "_"); | ||
if(bot.getPlaylistLoader().getPlaylist(pname)==null) | ||
event.reply(event.getClient().getError()+" Playlist `"+pname+"` doesn't exist!"); | ||
else | ||
{ | ||
try | ||
{ | ||
bot.getPlaylistLoader().deletePlaylist(pname); | ||
event.reply(event.getClient().getSuccess()+" Successfully deleted playlist `"+pname+"`!"); | ||
} | ||
catch(IOException e) | ||
{ | ||
event.reply(event.getClient().getError()+" I was unable to delete the playlist: "+e.getLocalizedMessage()); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,4 @@ else if(list.isEmpty()) | |
event.reply(builder.toString()); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.