diff --git a/pom.xml b/pom.xml
index a59d692..3fcc6da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
dev.struchkov.godfather
telegram-bot
- 0.0.18
+ 0.0.19
pom
diff --git a/telegram-core/pom.xml b/telegram-core/pom.xml
index af92a34..2bf536b 100644
--- a/telegram-core/pom.xml
+++ b/telegram-core/pom.xml
@@ -5,7 +5,7 @@
dev.struchkov.godfather
telegram-bot
- 0.0.18
+ 0.0.19
telegram-core
diff --git a/telegram-core/src/main/java/dev/struchkov/godfather/telegram/listen/EventDistributorService.java b/telegram-core/src/main/java/dev/struchkov/godfather/telegram/listen/EventDistributorService.java
index 0e8f25c..18b00f0 100644
--- a/telegram-core/src/main/java/dev/struchkov/godfather/telegram/listen/EventDistributorService.java
+++ b/telegram-core/src/main/java/dev/struchkov/godfather/telegram/listen/EventDistributorService.java
@@ -14,6 +14,7 @@ import org.telegram.telegrambots.meta.api.objects.CallbackQuery;
import org.telegram.telegrambots.meta.api.objects.ChatMemberUpdated;
import org.telegram.telegrambots.meta.api.objects.Message;
import org.telegram.telegrambots.meta.api.objects.Update;
+import org.telegram.telegrambots.meta.api.objects.User;
import java.util.List;
import java.util.Map;
@@ -64,7 +65,7 @@ public class EventDistributorService implements EventDistributor {
private boolean isEvent(Message message) {
return message.getChannelChatCreated() != null
|| message.getDeleteChatPhoto() != null
- || message.getNewChatMembers() != null
+ || isNewChatMember(message.getNewChatMembers())
|| message.getNewChatTitle() != null
|| message.getNewChatPhoto() != null
|| message.getVideoChatEnded() != null
@@ -74,6 +75,14 @@ public class EventDistributorService implements EventDistributor {
|| message.getVideoChatStarted() != null;
}
+ private boolean isNewChatMember(List newChatMembers) {
+ if (newChatMembers == null) {
+ return true;
+ } else {
+ return !newChatMembers.isEmpty();
+ }
+ }
+
private Optional> getEventProvider(String type) {
return Optional.ofNullable(eventProviderMap.get(type));
}