Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #214 from book000/fix/vcspeaker-cmd-notify
Browse files Browse the repository at this point in the history
fix: vcspeaker serverコマンド周りの動作がおかしい問題修正
  • Loading branch information
yuuahp authored May 20, 2023
2 parents 5b8af3e + 768970a commit a78e6d5
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.jaoafa.jdavcspeaker.Framework.Command.CmdSubstrate;
import com.jaoafa.jdavcspeaker.Lib.LibEmbedColor;
import com.jaoafa.jdavcspeaker.Lib.MultipleServer;
import com.jaoafa.jdavcspeaker.Main;
import com.jaoafa.jdavcspeaker.Player.GuildMusicManager;
import com.jaoafa.jdavcspeaker.Player.PlayerManager;
import com.jaoafa.jdavcspeaker.Player.TrackScheduler;
Expand Down Expand Up @@ -66,8 +65,8 @@ public void hooker(JDA jda, Guild guild,
SlashCommandInteractionEvent event, String subCmd) {
switch (subCmd) {
case "server:add" -> addServer(guild, channel, member, event);
case "server:notify" -> removeServer(guild, member, event);
case "server:remove" -> setNotifyChannel(guild, member, event);
case "server:notify" -> setNotifyChannel(guild, member, event);
case "server:remove" -> removeServer(guild, member, event);
case "debug:queue" -> showDebugQueue(member, event);
}
}
Expand Down Expand Up @@ -150,11 +149,11 @@ void setNotifyChannel(Guild guild, Member member, SlashCommandInteractionEvent e
return;
}

OptionMapping channelOpt = event.getOption("channel");
boolean isSuccessful =
MultipleServer
.setNotifyChannel(guild,
Main.getExistsOption(event, "channel")
.getAsChannel().asGuildMessageChannel()
channelOpt != null ? channelOpt.getAsChannel().asGuildMessageChannel() : null
);

cmdFlow.success("%s が通知チャンネルの設定をリクエストしました: %s", event.getUser().getAsTag(), isSuccessful ? "成功" : "失敗");
Expand Down

0 comments on commit a78e6d5

Please sign in to comment.