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 #223 from book000/feat/disable-sent2join-option
Browse files Browse the repository at this point in the history
feat: メッセージがVCテキストチャンネルに送信された場合に自動参加する機能の無効化オプションを追加
  • Loading branch information
yuuahp authored Jul 10, 2023
2 parents 9cc81bc + 5296082 commit 4a3a49f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jaoafa.jdavcspeaker.Event;

import com.jaoafa.jdavcspeaker.Lib.*;
import com.jaoafa.jdavcspeaker.Main;
import com.jaoafa.jdavcspeaker.MessageProcessor.BaseProcessor;
import com.jaoafa.jdavcspeaker.MessageProcessor.ProcessorType;
import net.dv8tion.jda.api.EmbedBuilder;
Expand Down Expand Up @@ -53,9 +54,10 @@ public void onMessageReceived(@NotNull MessageReceivedEvent event) {
guild.getSelfMember().getVoiceState().getChannel() == null) {
// 自身がどこにも入っていない場合

if (member.getVoiceState() != null &&
if (!Main.getArgs().isDisableAutoJoinByMessage &&
member.getVoiceState() != null &&
member.getVoiceState().getChannel() != null) {
// メッセージ送信者がどこかのVCに入っている場合
// メッセージ送信者がどこかのVCに入っている場合(機能が有効な場合に限る)

guild.getAudioManager().openAudioConnection(member.getVoiceState().getChannel()); // 参加
if (MultipleServer.getVCChannel(guild) != null) {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/jaoafa/jdavcspeaker/Lib/VCSpeakerArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ public class VCSpeakerArgs {
public boolean isOnlyRemoveCmd;

@Option(name = "--disable-auto-join",
usage = "VCへの自動参加を無効化")
usage = "ユーザのVC参加によるVCへの自動参加を無効化")
public boolean isDisableAutoJoin;

@Option(name = "--disable-auto-join-by-message",
usage = "メッセージ送信によるVCへの自動参加を無効化")
public boolean isDisableAutoJoinByMessage;

@Option(name = "--disable-auto-move",
usage = "VC間の自動移動を無効化")
public boolean isDisableAutoMove;
Expand Down

0 comments on commit 4a3a49f

Please sign in to comment.