Created
February 9, 2024 19:01
-
-
Save centralhardware/e4aac70e2e7659658ae625948760c9d7 to your computer and use it in GitHub Desktop.
sdf.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void send(Object method, User user){ | |
limiter.limit(() -> { | |
try { | |
telegramUtil.logSend(method); | |
if (method instanceof BotApiMethodMessage botApiMethodMessage){ | |
absSender.execute(botApiMethodMessage); | |
} else if (method instanceof SendPhoto sendPhoto){ | |
absSender.execute(sendPhoto); | |
} else if (method instanceof DeleteMessage deleteMessage){ | |
absSender.execute(deleteMessage); | |
} else if (method instanceof AnswerCallbackQuery answerCallbackQuery){ | |
absSender.execute(answerCallbackQuery); | |
} else if (method instanceof SendChatAction sendChatAction){ | |
absSender.execute(sendChatAction); | |
} else if (method instanceof AnswerInlineQuery answerInlineQuery){ | |
absSender.execute(answerInlineQuery); | |
} else if (method instanceof SendDocument sendDocument){ | |
absSender.execute(sendDocument); | |
} else if (method instanceof EditMessageText editMessageText){ | |
absSender.execute(editMessageText); | |
} else if (method instanceof EditMessageReplyMarkup editMessageReplyMarkup){ | |
absSender.execute(editMessageReplyMarkup); | |
} | |
telegramUtil.saveStatisticOutcome(method, user); | |
} catch (Throwable t){ | |
log.warn("",t); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment