diff --git a/pom.xml b/pom.xml
index 7f12fd7..da59a3a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
dev.struchkov.godfather
telegram-bot
- 0.0.10
+ 0.0.11
pom
@@ -33,7 +33,7 @@
UTF-8
UTF-8
- 0.0.8
+ 0.0.9
6.1.0
3.10.1
diff --git a/telegram-core/pom.xml b/telegram-core/pom.xml
index b13e2f5..4d1d95f 100644
--- a/telegram-core/pom.xml
+++ b/telegram-core/pom.xml
@@ -5,7 +5,7 @@
dev.struchkov.godfather
telegram-bot
- 0.0.10
+ 0.0.11
telegram-core
diff --git a/telegram-core/src/main/java/dev/struchkov/godfather/telegram/listen/TelegramConnect.java b/telegram-core/src/main/java/dev/struchkov/godfather/telegram/TelegramConnect.java
similarity index 89%
rename from telegram-core/src/main/java/dev/struchkov/godfather/telegram/listen/TelegramConnect.java
rename to telegram-core/src/main/java/dev/struchkov/godfather/telegram/TelegramConnect.java
index 321613b..8cc3f91 100644
--- a/telegram-core/src/main/java/dev/struchkov/godfather/telegram/listen/TelegramConnect.java
+++ b/telegram-core/src/main/java/dev/struchkov/godfather/telegram/TelegramConnect.java
@@ -1,9 +1,8 @@
-package dev.struchkov.godfather.telegram.listen;
+package dev.struchkov.godfather.telegram;
-import dev.struchkov.godfather.telegram.ProxyConfig;
-import dev.struchkov.godfather.telegram.TelegramBot;
-import dev.struchkov.godfather.telegram.TelegramPollingBot;
+import dev.struchkov.godfather.telegram.config.ProxyConfig;
import dev.struchkov.godfather.telegram.config.TelegramPollingConfig;
+import dev.struchkov.godfather.telegram.listen.EventDistributorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.telegram.telegrambots.bots.DefaultBotOptions;
@@ -25,8 +24,10 @@ public class TelegramConnect {
private static final Logger log = LoggerFactory.getLogger(TelegramConnect.class);
private TelegramBot telegramBot;
+ private final TelegramPollingConfig telegramPollingConfig;
public TelegramConnect(TelegramPollingConfig telegramPollingConfig) {
+ this.telegramPollingConfig = telegramPollingConfig;
initLongPolling(telegramPollingConfig);
}
@@ -46,6 +47,7 @@ public class TelegramConnect {
// }
private void initLongPolling(TelegramPollingConfig telegramPollingConfig) {
+
final ProxyConfig proxyConfig = telegramPollingConfig.getProxyConfig();
if (proxyConfig != null && proxyConfig.getPassword() != null) {
try {
@@ -105,12 +107,16 @@ public class TelegramConnect {
}
}
- AbsSender getAdsSender() {
+ public AbsSender getAdsSender() {
return telegramBot.getAdsSender();
}
- void initEventDistributor(EventDistributorService eventDistributor) {
+ public void initEventDistributor(EventDistributorService eventDistributor) {
telegramBot.initEventDistributor(eventDistributor);
}
+ public String getToken() {
+ return telegramPollingConfig.getBotToken();
+ }
+
}
diff --git a/telegram-core/src/main/java/dev/struchkov/godfather/telegram/autoresponder/MessageAutoresponderTelegram.java b/telegram-core/src/main/java/dev/struchkov/godfather/telegram/autoresponder/MailAutoresponderTelegram.java
similarity index 56%
rename from telegram-core/src/main/java/dev/struchkov/godfather/telegram/autoresponder/MessageAutoresponderTelegram.java
rename to telegram-core/src/main/java/dev/struchkov/godfather/telegram/autoresponder/MailAutoresponderTelegram.java
index cc05be1..3331c17 100644
--- a/telegram-core/src/main/java/dev/struchkov/godfather/telegram/autoresponder/MessageAutoresponderTelegram.java
+++ b/telegram-core/src/main/java/dev/struchkov/godfather/telegram/autoresponder/MailAutoresponderTelegram.java
@@ -2,26 +2,23 @@ package dev.struchkov.godfather.telegram.autoresponder;
import dev.struchkov.godfather.context.domain.content.Mail;
import dev.struchkov.godfather.context.service.PersonSettingService;
-import dev.struchkov.godfather.context.service.UnitPointerService;
+import dev.struchkov.godfather.context.service.StorylineService;
import dev.struchkov.godfather.context.service.sender.Sending;
import dev.struchkov.godfather.core.GeneralAutoResponder;
-import java.util.List;
-
/**
* TODO: Добавить описание класса.
*
* @author upagge [18.08.2019]
*/
-public class MessageAutoresponderTelegram extends GeneralAutoResponder {
+public class MailAutoresponderTelegram extends GeneralAutoResponder {
- public MessageAutoresponderTelegram(
+ public MailAutoresponderTelegram(
Sending sending,
PersonSettingService personSettingService,
- UnitPointerService unitPointerService,
- List