All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.viber.bot.event.callback.OnMessageReceived Maven / Gradle / Ivy

package com.viber.bot.event.callback;

import com.viber.bot.Response;
import com.viber.bot.event.BotEventListener;
import com.viber.bot.event.incoming.IncomingMessageEvent;
import com.viber.bot.message.Message;

import java.util.concurrent.Future;

import static com.google.common.base.Preconditions.checkArgument;

public interface OnMessageReceived extends BotEventListener {
    void messageReceived(IncomingMessageEvent event, Message message, Response response);

    @Override
    default Future emit(final Object... args) {
        checkArgument(args.length == 3);
        messageReceived((IncomingMessageEvent) args[0], (Message) args[1], (Response) args[2]);
        return nothing;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy