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

Explore the source code of the class SendChatActionRequest.java


package com.antonioaltieri.telegram.botapi.requests;

import java.util.HashMap;
import java.util.Map;

public class SendChatActionRequest implements ApiRequest {

    private Map args = new HashMap<>();

    public SendChatActionRequest(long chatId, ChatAction chatAction) {
        args.put("chat_id", String.valueOf(chatId));
        args.put("action", chatAction.getAction());
    }

    @Override
    public String getMethodName() {
        return "sendChatAction";
    }

    @Override
    public ResultTypes getResultType() {
        return ResultTypes.BOOLEAN;
    }

    @Override
    public Map getArgs() {
        return args;
    }

    @Override
    public RequestStrategy getRequestStrategy() {
        return new PostStrategy();
    }

    @Override
    public String toString() {
        return "SendChatActionRequest{" +
                "args=" + args +
                '}';
    }
}