diff --git a/.circleci/config.yml b/.circleci/config.yml index b16d96368..d8fb4dc6c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: build: docker: # specify the version you desire here - - image: circleci/openjdk:8u171-jdk + - image: circleci/openjdk:11.0.3-jdk-stretch-node-browsers-legacy # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 6693a5074..894761f56 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -15,15 +15,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 with: - java-version: 1.8 + java-version: '11' + distribution: 'adopt' + architecture: x64 + cache: maven - name: Build with Maven - run: mvn -B package --file pom.xml - - run: mkdir staging && cp target/*.jar staging - - uses: actions/upload-artifact@v2 - with: - name: Package - path: staging + run: mvn --batch-mode --update-snapshots verify \ No newline at end of file diff --git a/src/main/java/dev/cosgy/JMusicBot/slashcommands/dj/PlaylistCmd.java b/src/main/java/dev/cosgy/JMusicBot/slashcommands/dj/PlaylistCmd.java index 5eb82f401..26f09610d 100644 --- a/src/main/java/dev/cosgy/JMusicBot/slashcommands/dj/PlaylistCmd.java +++ b/src/main/java/dev/cosgy/JMusicBot/slashcommands/dj/PlaylistCmd.java @@ -82,18 +82,17 @@ public MakelistCmd(Bot bot) { @Override public void doCommand(CommandEvent event) { - String pname = event.getArgs().replaceAll("\\s+", "_"); + String pName = event.getArgs().replaceAll("\\s+", "_"); String guildId = event.getGuild().getId(); - if (pname.isEmpty()) { - event.replyError("プレイリスト名を指定してください。"); - return; + if(pName == null || pName.isEmpty()) + { + event.replyError("プレイリストの名前を入力してください。"); } - - if (bot.getPlaylistLoader().getPlaylist(guildId, pname) == null) { + else if(bot.getPlaylistLoader().getPlaylist(guildId, pName) == null) { try { - bot.getPlaylistLoader().createPlaylist(guildId, pname); - event.reply(event.getClient().getSuccess() + "再生リスト `" + pname + "` を作成しました"); + bot.getPlaylistLoader().createPlaylist(guildId, pName); + event.reply(event.getClient().getSuccess() + "再生リスト `" + pName + "` を作成しました"); } catch (IOException e) { if (event.isOwner() || event.getMember().isOwner()) { event.replyError("曲の読み込み中にエラーが発生しました。\n" + @@ -105,7 +104,7 @@ public void doCommand(CommandEvent event) { event.reply(event.getClient().getError() + " 再生リストを作成できませんでした。:" + e.getLocalizedMessage()); } } else { - event.reply(event.getClient().getError() + " 再生リスト `" + pname + "` は既に存在します"); + event.reply(event.getClient().getError() + " 再生リスト `" + pName + "` は既に存在します"); } } @@ -117,8 +116,10 @@ public void doCommand(SlashCommandEvent event) { } String pname = event.getOption("name").getAsString(); String guildId = event.getGuild().getId(); - - if (bot.getPlaylistLoader().getPlaylist(guildId, pname) == null) { + if(pname == null || pname.isEmpty()) + { + event.reply(client.getError() + "プレイリストの名前を入力してください。").queue(); + } else if(bot.getPlaylistLoader().getPlaylist(guildId, pname) == null) { try { bot.getPlaylistLoader().createPlaylist(guildId, pname); event.reply(client.getSuccess() + "再生リスト `" + pname + "` を作成しました").queue();