[AB-xxx] not requiring async voice channel listeners

fixing duplicated error reporting for command received handler
This commit is contained in:
Sheldan
2022-02-10 23:05:35 +01:00
parent 986b65a1e4
commit ae3c66384f
2 changed files with 5 additions and 5 deletions

View File

@@ -37,6 +37,7 @@ import net.dv8tion.jda.api.hooks.ListenerAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.UnexpectedRollbackException;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
@@ -149,10 +150,9 @@ public class CommandReceivedHandler extends ListenerAdapter {
try {
UnParsedCommandResult result = getUnparsedCommandResult(message);
CompletableFuture<CommandParseResult> parsingFuture = getParametersFromMessage(message, result);
parsingFuture.thenAccept(parsedParameters ->
self.executeCommand(event, parsedParameters.getCommand(), parsedParameters.getParameters())
).exceptionally(throwable -> {
self.reportException(event, result.getCommand(), throwable, "Exception when executing or parsing command.");
parsingFuture.thenAccept(parsedParameters -> self.executeCommand(event, parsedParameters.getCommand(), parsedParameters.getParameters()));
parsingFuture.exceptionally(throwable -> {
self.reportException(event, result.getCommand(), throwable, "Exception when parsing command.");
return null;
});
} catch (Exception e) {

View File

@@ -17,7 +17,7 @@ import java.util.List;
@Slf4j
public class AsyncVoiceChannelLeftListenerBean extends ListenerAdapter {
@Autowired
@Autowired(required = false)
private List<AsyncVoiceChannelLeftListener> listenerList;
@Autowired