mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-09-09 17:14:55 +00:00
[AB-xxx] not requiring async voice channel listeners
fixing duplicated error reporting for command received handler
This commit is contained in:
@@ -37,6 +37,7 @@ import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.UnexpectedRollbackException;
|
||||||
import org.springframework.transaction.annotation.Isolation;
|
import org.springframework.transaction.annotation.Isolation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -149,10 +150,9 @@ public class CommandReceivedHandler extends ListenerAdapter {
|
|||||||
try {
|
try {
|
||||||
UnParsedCommandResult result = getUnparsedCommandResult(message);
|
UnParsedCommandResult result = getUnparsedCommandResult(message);
|
||||||
CompletableFuture<CommandParseResult> parsingFuture = getParametersFromMessage(message, result);
|
CompletableFuture<CommandParseResult> parsingFuture = getParametersFromMessage(message, result);
|
||||||
parsingFuture.thenAccept(parsedParameters ->
|
parsingFuture.thenAccept(parsedParameters -> self.executeCommand(event, parsedParameters.getCommand(), parsedParameters.getParameters()));
|
||||||
self.executeCommand(event, parsedParameters.getCommand(), parsedParameters.getParameters())
|
parsingFuture.exceptionally(throwable -> {
|
||||||
).exceptionally(throwable -> {
|
self.reportException(event, result.getCommand(), throwable, "Exception when parsing command.");
|
||||||
self.reportException(event, result.getCommand(), throwable, "Exception when executing or parsing command.");
|
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class AsyncVoiceChannelLeftListenerBean extends ListenerAdapter {
|
public class AsyncVoiceChannelLeftListenerBean extends ListenerAdapter {
|
||||||
|
|
||||||
@Autowired
|
@Autowired(required = false)
|
||||||
private List<AsyncVoiceChannelLeftListener> listenerList;
|
private List<AsyncVoiceChannelLeftListener> listenerList;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
Reference in New Issue
Block a user