Skip to content

Commit

Permalink
CIで使用するJavaバージョンを11に変更
Browse files Browse the repository at this point in the history
  • Loading branch information
kosugikun committed Apr 7, 2022
1 parent 16f40b1 commit df6a798
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 12 additions & 11 deletions src/main/java/dev/cosgy/JMusicBot/slashcommands/dj/PlaylistCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -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" +
Expand All @@ -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 + "` は既に存在します");
}
}

Expand All @@ -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();
Expand Down

0 comments on commit df6a798

Please sign in to comment.