src/main/java/seedu/address/bot/ArkBot.java
public Ability onPhotoCommand() {
        return Ability
                .builder()
                .name(DEFAULT)
                .flag(PHOTO)
                .info("receives Photos")
                .input(0)
                .locality(Locality.ALL)
                .privacy(PRIVACY_SETTING)
                .action((MessageContext ctx) -> Platform.runLater(() -> {
                    Update update = ctx.update();
                    if (update.hasMessage() && update.getMessage().hasPhoto()) {
                        java.io.File picture = getPictureFileFromUpdate(update);
                        try {
                            ReadOnlyParcel retrievedParcel = retrieveParcelFromPictureFile(picture);
                            logger.info("The retrieved parcel is: " + retrievedParcel);
                            if (retrievedParcel.equals(null)) {
                                sender.send("Sorry, I didn't seem to understand your image. Please try again.",
                                        ctx.chatId());
                            } else if (this.waitingForImage) {
                                int indexZeroBased = model.getUncompletedParcelList().indexOf(retrievedParcel);
                                if (indexZeroBased < 0) {
                                    sender.send("The parcel cannot be found! Please try again.",
                                            ctx.chatId());
                                } else {
                                    performCompleteParcel(sender, logic, indexZeroBased + 1,
                                            retrievedParcel, ctx.chatId());
                                }
                            } else {
                                sender.send("Here are the details of the parcel: \n"
                                                + retrievedParcel.toString(), ctx.chatId());
                            }
                        } catch (ParseException | CommandException | QRreadException e) {
                            sender.send(BOT_MESSAGE_FAILURE, ctx.chatId());
                        } catch (TelegramApiException e) {
                            e.printStackTrace();
                        }
                    }
                })).build();
    }
/**
     * This ability has an extra "flag". It needs a photo to activate.
     */
This ability has an extra "flag". It needs a photo to activate.
This ability has an extra " flag " . It needs a photo to activate .
public Ability onPhotoCommand() {
        return Ability
                .builder()
                .name(DEFAULT)
                .flag(PHOTO)
                .info("receives Photos")
                .input(0)
                .locality(Locality.ALL)
                .privacy(PRIVACY_SETTING)
                .action((MessageContext ctx) -> Platform.runLater(() -> {
                    Update update = ctx.update();
                    if (update.hasMessage() && update.getMessage().hasPhoto()) {
                        java.io.File picture = getPictureFileFromUpdate(update);
                        try {
                            ReadOnlyParcel retrievedParcel = retrieveParcelFromPictureFile(picture);
                            logger.info("The retrieved parcel is: " + retrievedParcel);
                            if (retrievedParcel.equals(null)) {
                                sender.send("Sorry, I didn't seem to understand your image. Please try again.",
                                        ctx.chatId());
                            } else if (this.waitingForImage) {
                                int indexZeroBased = model.getUncompletedParcelList().indexOf(retrievedParcel);
                                if (indexZeroBased < 0) {
                                    sender.send("The parcel cannot be found! Please try again.",
                                            ctx.chatId());
                                } else {
                                    performCompleteParcel(sender, logic, indexZeroBased + 1,
                                            retrievedParcel, ctx.chatId());
                                }
                            } else {
                                sender.send("Here are the details of the parcel: \n"
                                                + retrievedParcel.toString(), ctx.chatId());
                            }
                        } catch (ParseException | CommandException | QRreadException e) {
                            sender.send(BOT_MESSAGE_FAILURE, ctx.chatId());
                        } catch (TelegramApiException e) {
                            e.printStackTrace();
                        }
                    }
                })).build();
    }
public Ability onPhotoCommand ( ) { return Ability . builder ( ) . name ( DEFAULT ) . flag ( PHOTO ) . info ( "receives Photos" ) . input ( 0 ) . locality ( Locality . ALL ) . privacy ( PRIVACY_SETTING ) . action ( ( MessageContext ctx ) -> Platform . runLater ( ( ) -> { Update update = ctx . update ( ) ; if ( update . hasMessage ( ) && update . getMessage ( ) . hasPhoto ( ) ) { java . io . File picture = getPictureFileFromUpdate ( update ) ; try { ReadOnlyParcel retrievedParcel = retrieveParcelFromPictureFile ( picture ) ; logger . info ( "The retrieved parcel is: " + retrievedParcel ) ; if ( retrievedParcel . equals ( null ) ) { sender . send ( "Sorry, I didn't seem to understand your image. Please try again." , ctx . chatId ( ) ) ; } else if ( this . waitingForImage ) { int indexZeroBased = model . getUncompletedParcelList ( ) . indexOf ( retrievedParcel ) ; if ( indexZeroBased < 0 ) { sender . send ( "The parcel cannot be found! Please try again." , ctx . chatId ( ) ) ; } else { performCompleteParcel ( sender , logic , indexZeroBased + 1 , retrievedParcel , ctx . chatId ( ) ) ; } } else { sender . send ( "Here are the details of the parcel: \n" + retrievedParcel . toString ( ) , ctx . chatId ( ) ) ; } } catch ( ParseException | CommandException | QRreadException e ) { sender . send ( BOT_MESSAGE_FAILURE , ctx . chatId ( ) ) ; } catch ( TelegramApiException e ) { e . printStackTrace ( ) ; } } } ) ) . build ( ) ; }
This ability has an extra "flag".
This ability has an extra " flag " .