godfather up to 0.0.32
This commit is contained in:
parent
7fda16b63c
commit
b25f085727
4
pom.xml
4
pom.xml
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-bot</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
@ -38,7 +38,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<godfather.core.ver>0.0.31</godfather.core.ver>
|
||||
<godfather.core.ver>0.0.32</godfather.core.ver>
|
||||
<telegrambots.ver>6.3.0</telegrambots.ver>
|
||||
|
||||
<haiti.version>2.0.0</haiti.version>
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>telegram-bot</artifactId>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-consumer</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-consumer</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-consumer-main</artifactId>
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-consumer</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-consumer-quarkus</artifactId>
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-consumer</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-consumer-simple</artifactId>
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>telegram-bot</artifactId>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-context</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-context</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-context-main</artifactId>
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-context</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-context-quarkus</artifactId>
|
||||
|
||||
|
@ -7,6 +7,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface TelegramSending extends Sending {
|
||||
|
||||
Uni<Void> sendNotSave(@NotNull String personId, @NotNull BoxAnswer boxAnswer);
|
||||
Uni<Void> sendNotSave(@NotNull BoxAnswer boxAnswer);
|
||||
|
||||
}
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>telegram-context</artifactId>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-context-simple</artifactId>
|
||||
|
||||
|
@ -6,6 +6,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface TelegramSending extends Sending {
|
||||
|
||||
void sendNotSave(@NotNull String personId, @NotNull BoxAnswer boxAnswer);
|
||||
void sendNotSave(@NotNull BoxAnswer boxAnswer);
|
||||
|
||||
}
|
||||
|
@ -5,8 +5,9 @@
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-bot</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
<module>telegram-core-main</module>
|
||||
<module>telegram-core-simple</module>
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-core</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-core-main</artifactId>
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>telegram-core</artifactId>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-core-quarkus</artifactId>
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-core</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-core-simple</artifactId>
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-bot</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-domain</artifactId>
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-bot</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-sender</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-sender</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-sender-main</artifactId>
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-sender</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-sender-quarkus</artifactId>
|
||||
|
||||
|
@ -50,8 +50,8 @@ public class TelegramSender implements TelegramSending {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uni<Void> send(@NotNull String telegramId, @NotNull BoxAnswer boxAnswer) {
|
||||
return sendBoxAnswer(telegramId, boxAnswer, true);
|
||||
public Uni<Void> send(@NotNull BoxAnswer boxAnswer) {
|
||||
return sendBoxAnswer(boxAnswer, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,27 +60,28 @@ public class TelegramSender implements TelegramSending {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uni<Void> sendNotSave(@NotNull String telegramId, @NotNull BoxAnswer boxAnswer) {
|
||||
return sendBoxAnswer(telegramId, boxAnswer, false);
|
||||
public Uni<Void> sendNotSave(@NotNull BoxAnswer boxAnswer) {
|
||||
return sendBoxAnswer(boxAnswer, false);
|
||||
}
|
||||
|
||||
private Uni<Void> sendBoxAnswer(@NotNull String telegramId, @NotNull BoxAnswer boxAnswer, boolean saveMessageId) {
|
||||
private Uni<Void> sendBoxAnswer(@NotNull BoxAnswer boxAnswer, boolean saveMessageId) {
|
||||
return Uni.createFrom().voidItem()
|
||||
.onItem().transformToUni(
|
||||
v -> {
|
||||
final String recipientTelegramId = boxAnswer.getRecipientPersonId();
|
||||
if (boxAnswer.isReplace() && checkNotNull(senderRepository)) {
|
||||
return senderRepository.getLastSendMessage(telegramId)
|
||||
return senderRepository.getLastSendMessage(recipientTelegramId)
|
||||
.onItem().transformToUni(
|
||||
lastId -> {
|
||||
if (checkNotNull(lastId)) {
|
||||
return replaceMessage(telegramId, lastId, boxAnswer);
|
||||
return replaceMessage(recipientTelegramId, lastId, boxAnswer);
|
||||
} else {
|
||||
return sendMessage(telegramId, boxAnswer, saveMessageId);
|
||||
return sendMessage(recipientTelegramId, boxAnswer, saveMessageId);
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
return sendMessage(telegramId, boxAnswer, saveMessageId);
|
||||
return sendMessage(recipientTelegramId, boxAnswer, saveMessageId);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-sender</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-sender-simple</artifactId>
|
||||
|
||||
|
@ -50,8 +50,9 @@ public class TelegramSender implements TelegramSending {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void send(@NotNull String telegramId, @NotNull BoxAnswer boxAnswer) {
|
||||
sendBoxAnswer(telegramId, boxAnswer, true);
|
||||
public void send(@NotNull BoxAnswer boxAnswer) {
|
||||
isNotNull(boxAnswer.getRecipientPersonId());
|
||||
sendBoxAnswer(boxAnswer, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,12 +61,13 @@ public class TelegramSender implements TelegramSending {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendNotSave(@NotNull String telegramId, @NotNull BoxAnswer boxAnswer) {
|
||||
sendBoxAnswer(telegramId, boxAnswer, false);
|
||||
public void sendNotSave(@NotNull BoxAnswer boxAnswer) {
|
||||
sendBoxAnswer(boxAnswer, false);
|
||||
}
|
||||
|
||||
private void sendBoxAnswer(@NotNull String telegramId, @NotNull BoxAnswer boxAnswer, boolean saveMessageId) {
|
||||
isNotNull(telegramId, boxAnswer);
|
||||
private void sendBoxAnswer(BoxAnswer boxAnswer, boolean saveMessageId) {
|
||||
final String recipientTelegramId = boxAnswer.getRecipientPersonId();
|
||||
isNotNull(recipientTelegramId);
|
||||
|
||||
for (PreSendProcessing preSendProcessor : preSendProcessors) {
|
||||
boxAnswer = preSendProcessor.pretreatment(boxAnswer);
|
||||
@ -73,19 +75,19 @@ public class TelegramSender implements TelegramSending {
|
||||
|
||||
try {
|
||||
if (boxAnswer.isReplace() && checkNotNull(senderRepository)) {
|
||||
final Optional<Integer> optLastId = senderRepository.getLastSendMessage(telegramId);
|
||||
final Optional<Integer> optLastId = senderRepository.getLastSendMessage(recipientTelegramId);
|
||||
if (optLastId.isPresent()) {
|
||||
replaceMessage(telegramId, optLastId.get(), boxAnswer);
|
||||
replaceMessage(recipientTelegramId, optLastId.get(), boxAnswer);
|
||||
} else {
|
||||
sendMessage(telegramId, boxAnswer, saveMessageId);
|
||||
sendMessage(recipientTelegramId, boxAnswer, saveMessageId);
|
||||
}
|
||||
} else {
|
||||
sendMessage(telegramId, boxAnswer, saveMessageId);
|
||||
sendMessage(recipientTelegramId, boxAnswer, saveMessageId);
|
||||
}
|
||||
} catch (TelegramApiRequestException e) {
|
||||
log.error(e.getApiResponse());
|
||||
if (ERROR_REPLACE_MESSAGE.equals(e.getApiResponse())) {
|
||||
sendMessage(telegramId, boxAnswer, saveMessageId);
|
||||
sendMessage(recipientTelegramId, boxAnswer, saveMessageId);
|
||||
}
|
||||
} catch (TelegramApiException e) {
|
||||
log.error(e.getMessage());
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather.telegram</groupId>
|
||||
<artifactId>telegram-bot</artifactId>
|
||||
<version>0.0.42</version>
|
||||
<version>0.0.43</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>telegram-simple</artifactId>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user