This change was deliberate to support a proper structure for command arguments that could be parameterised and typed. The BDK never officially supported regular expressions so it was by chance that this worked for you in the versions prior. If you would like to use custom matchers, you can choose to extend CommandActivity
.
@Component
public class HelloCommand extends CommandActivity<CommandContext> {
@Autowired
private MessageService messageService;
@Override
protected ActivityMatcher<CommandContext> matcher() {
return m -> m.getTextContent().startsWith("/hello");
}
@Override
protected void onActivity(CommandContext context) {
String arg = context.getTextContent().substring(7);
messageService.send(context.getStreamId(), "Hello! " + arg);
}
@Override
protected ActivityInfo info() {
return new ActivityInfo()
.name("Hello Command")
.description("Says hello to people")
.type(ActivityType.COMMAND);
}
}