Add ultrashrug command
This commit is contained in:
parent
20b920fd23
commit
f1ccadec08
@ -22,6 +22,7 @@ public class Bot extends TelegramLongPollingCommandBot {
|
||||
register(new InsultCommand(this));
|
||||
register(new KysCommand(this));
|
||||
register(new PartyHardCommand(this));
|
||||
register(new UltrashrugCommand(this));
|
||||
|
||||
registerDefaultAction((sender, message)->{
|
||||
logger.info(Utils.logMessage(message));
|
||||
|
@ -0,0 +1,29 @@
|
||||
package eu.mikroskeem.bot.maerahn.commands;
|
||||
|
||||
import eu.mikroskeem.bot.maerahn.Bot;
|
||||
import org.slf4j.Logger;
|
||||
import org.telegram.telegrambots.TelegramApiException;
|
||||
import org.telegram.telegrambots.api.methods.send.SendMessage;
|
||||
import org.telegram.telegrambots.api.objects.Chat;
|
||||
import org.telegram.telegrambots.api.objects.User;
|
||||
import org.telegram.telegrambots.bots.AbsSender;
|
||||
import org.telegram.telegrambots.bots.commands.BotCommand;
|
||||
|
||||
public class UltrashrugCommand extends BotCommand {
|
||||
Logger logger;
|
||||
public UltrashrugCommand(Bot bot){
|
||||
super("ultrashrug", "Send ultrashrug");
|
||||
logger = bot.logger;
|
||||
}
|
||||
@Override public void execute(AbsSender absSender, User user, Chat chat, String[] strings) {
|
||||
SendMessage message = new SendMessage();
|
||||
message.setChatId(chat.getId().toString());
|
||||
message.setText("https://i.imgur.com/MyIOFpy.png");
|
||||
try {
|
||||
absSender.sendMessage(message);
|
||||
} catch (TelegramApiException e){
|
||||
logger.error("Failed to send reply for /ultrashrug command!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user