src/main/java/seedu/address/bot/ArkBot.java
public Ability completeCommand() {
        return Ability
                .builder()
                .name("complete")
                .info("completes a parcel in list")
                .input(0)
                .locality(Locality.ALL)
                .privacy(PRIVACY_SETTING)
                .action(ctx -> Platform.runLater(() -> {
                    String input = combineArguments(ctx.arguments());
                    try {
                        if (input.trim().equals("")) {
                            this.waitingForImage = true;
                            sender.send(BOT_MESSAGE_COMPLETE_COMMAND, ctx.chatId());
                        } else if (containsAllNumbers(input.trim())) {
                            logic.execute(EditCommand.COMMAND_WORD + " "
                                    + input + BOT_SET_COMPLETED);
                            ObservableList<ReadOnlyParcel> parcels = model.getUncompletedParcelList();
                            sender.send(parseDisplayParcels(formatParcelsForBot(parcels)), ctx.chatId());
                        } else {
                            sender.send(BOT_MESSAGE_FAILURE, ctx.chatId());
                        }
                    } catch (CommandException | ParseException e) {
                        sender.send(BOT_MESSAGE_FAILURE, ctx.chatId());
                    }
                }))
                .build();
    }
/**
     * Command to complete tasks with QR code or number
     */
Command to complete tasks with QR code or number
Command to complete tasks with QR code or number
public Ability completeCommand() {
        return Ability
                .builder()
                .name("complete")
                .info("completes a parcel in list")
                .input(0)
                .locality(Locality.ALL)
                .privacy(PRIVACY_SETTING)
                .action(ctx -> Platform.runLater(() -> {
                    String input = combineArguments(ctx.arguments());
                    try {
                        if (input.trim().equals("")) {
                            this.waitingForImage = true;
                            sender.send(BOT_MESSAGE_COMPLETE_COMMAND, ctx.chatId());
                        } else if (containsAllNumbers(input.trim())) {
                            logic.execute(EditCommand.COMMAND_WORD + " "
                                    + input + BOT_SET_COMPLETED);
                            ObservableList<ReadOnlyParcel> parcels = model.getUncompletedParcelList();
                            sender.send(parseDisplayParcels(formatParcelsForBot(parcels)), ctx.chatId());
                        } else {
                            sender.send(BOT_MESSAGE_FAILURE, ctx.chatId());
                        }
                    } catch (CommandException | ParseException e) {
                        sender.send(BOT_MESSAGE_FAILURE, ctx.chatId());
                    }
                }))
                .build();
    }
public Ability completeCommand ( ) { return Ability . builder ( ) . name ( "complete" ) . info ( "completes a parcel in list" ) . input ( 0 ) . locality ( Locality . ALL ) . privacy ( PRIVACY_SETTING ) . action ( ctx -> Platform . runLater ( ( ) -> { String input = combineArguments ( ctx . arguments ( ) ) ; try { if ( input . trim ( ) . equals ( "" ) ) { this . waitingForImage = true ; sender . send ( BOT_MESSAGE_COMPLETE_COMMAND , ctx . chatId ( ) ) ; } else if ( containsAllNumbers ( input . trim ( ) ) ) { logic . execute ( EditCommand . COMMAND_WORD + " " + input + BOT_SET_COMPLETED ) ; ObservableList < ReadOnlyParcel > parcels = model . getUncompletedParcelList ( ) ; sender . send ( parseDisplayParcels ( formatParcelsForBot ( parcels ) ) , ctx . chatId ( ) ) ; } else { sender . send ( BOT_MESSAGE_FAILURE , ctx . chatId ( ) ) ; } } catch ( CommandException | ParseException e ) { sender . send ( BOT_MESSAGE_FAILURE , ctx . chatId ( ) ) ; } } ) ) . build ( ) ; }
Command to complete tasks with QR code or number
Command to complete tasks with QR code or number