use of co.aurasphere.botmill.core.internal.exception.BotMillIllegalAttachmentException in project fb-botmill by BotMill.
the class AttachmentAutoReply method createResponse.
/**
* {@inheritDoc} Replies with an attachment.
*/
@Override
public FbBotMillResponse createResponse(MessageEnvelope envelope) {
FbBotMillResponse response = null;
switch(attachmentType) {
case FILE:
response = ReplyFactory.addFileAttachment(url).build(envelope);
break;
case IMAGE:
response = ReplyFactory.addImageAttachment(url).build(envelope);
break;
case AUDIO:
response = ReplyFactory.addAudioAttachment(url).build(envelope);
break;
case VIDEO:
response = ReplyFactory.addVideoAttachment(url).build(envelope);
break;
default:
String message = "Illegal attachment of type [ " + attachmentType.name() + " ] for AttachmentAutoReply";
logger.error(message);
throw new BotMillIllegalAttachmentException(message);
}
return response;
}
Aggregations