Add /always command
"helps with whiny ass bitches"
This commit is contained in:
parent
f685e40c1e
commit
a8562a288f
1
pom.xml
1
pom.xml
@ -102,5 +102,4 @@
|
||||
<version>v2.3.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -1,5 +1,6 @@
|
||||
package eu.mikroskeem.bot.maerahn;
|
||||
|
||||
import eu.mikroskeem.bot.maerahn.commands.AlwaysCommand;
|
||||
import eu.mikroskeem.bot.maerahn.commands.LennyCommand;
|
||||
import eu.mikroskeem.bot.maerahn.commands.ShrugCommand;
|
||||
import lombok.Getter;
|
||||
@ -19,6 +20,7 @@ public class Bot extends TelegramLongPollingCommandBot {
|
||||
//register(new FacepalmCommand(this));
|
||||
register(new ShrugCommand(this));
|
||||
register(new LennyCommand(this));
|
||||
register(new AlwaysCommand(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 AlwaysCommand extends BotCommand {
|
||||
Logger logger;
|
||||
public AlwaysCommand(Bot bot){
|
||||
super("always", "Send pic of always");
|
||||
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/BoVfl7R.png");
|
||||
try {
|
||||
absSender.sendMessage(message);
|
||||
} catch (TelegramApiException e){
|
||||
logger.error("Failed to send reply for /always command!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user