com.mocean.modules.command.mc.TgSendAnimation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moceanapisdk Show documentation
Show all versions of moceanapisdk Show documentation
This is an Mocean SDK written in java. To use it you will need a mocean account. Signup for free at https://moceanapi.com
package com.mocean.modules.command.mc;
import java.util.ArrayList;
import java.util.HashMap;
public class TgSendAnimation extends AbstractMc{
public TgSendAnimation() {
this(new HashMap<>());
}
public TgSendAnimation(HashMap params) {
super(params);
}
@Override
protected ArrayList requiredKey() {
return new ArrayList(){{
add("from");
add("to");
add("content");
}};
}
@Override
protected String action() {
return "send-telegram";
}
public TgSendAnimation from (String id) {
return this.from(id,"bot_username");
}
public TgSendAnimation from (String id, String type) {
HashMap params = new HashMap();
params.put("id",id);
params.put("type",type);
this.requestData.put("from",params);
return this;
}
public TgSendAnimation to (String id) {
return this.to(id,"chat_id");
}
public TgSendAnimation to (String id, String type) {
HashMap params = new HashMap();
params.put("id",id);
params.put("type",type);
this.requestData.put("to",params);
return this;
}
public TgSendAnimation content (String url) {
return this.content(url,"");
}
public TgSendAnimation content (String url, String text) {
HashMap params = new HashMap();
params.put("rich_media_url",url);
params.put("text",text);
params.put("type","animation");
this.requestData.put("content",params);
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy