mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-27 14:23:56 +00:00
[AB-196] adding confirmation requirement to various commands
refactoring command received handler in order to re-use when confirmation has been given removing reaction from showSuggestion and remind command adding log message for message deleted message, in case the member left all commands from now on must work without the member field from the message, as this is not available when retrieving the message
This commit is contained in:
@@ -122,6 +122,9 @@ public class CommandReceivedHandlerTest {
|
||||
@Mock
|
||||
private List<Member> members;
|
||||
|
||||
@Mock
|
||||
private Member member;
|
||||
|
||||
@Mock
|
||||
private Bag<Role> roles;
|
||||
|
||||
@@ -161,6 +164,8 @@ public class CommandReceivedHandlerTest {
|
||||
when(commandManager.isCommand(message)).thenReturn(true);
|
||||
when(event.getGuild()).thenReturn(guild);
|
||||
when(event.getChannel()).thenReturn(channel);
|
||||
when(event.getMember()).thenReturn(member);
|
||||
when(message.getGuild()).thenReturn(guild);
|
||||
when(guild.getIdLong()).thenReturn(SERVER_ID);
|
||||
when(message.getContentRaw()).thenReturn(MESSAGE_CONTENT_COMMAND_ONLY);
|
||||
when(commandManager.getCommandName(anyString(), eq(SERVER_ID))).thenReturn(COMMAND_NAME);
|
||||
@@ -286,9 +291,9 @@ public class CommandReceivedHandlerTest {
|
||||
parameterHandlers.add(parameterHandler);
|
||||
parameterHandlers.add(secondParameterHandler);
|
||||
when(event.isFromGuild()).thenReturn(true);
|
||||
when(message.getGuild()).thenReturn(guild);
|
||||
when(event.getMessage()).thenReturn(message);
|
||||
when(commandManager.isCommand(message)).thenReturn(true);
|
||||
when(event.getGuild()).thenReturn(guild);
|
||||
when(guild.getIdLong()).thenReturn(SERVER_ID);
|
||||
when(message.getContentRaw()).thenReturn(messageContentTwoParameter);
|
||||
when(commandManager.getCommandName(anyString(), eq(SERVER_ID))).thenReturn(COMMAND_NAME);
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.sheldan.abstracto.core.command.service;
|
||||
import dev.sheldan.abstracto.core.command.Command;
|
||||
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
|
||||
import dev.sheldan.abstracto.core.command.config.Parameter;
|
||||
import dev.sheldan.abstracto.core.command.model.CommandServiceBean;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
Reference in New Issue
Block a user