Поправил преобразование сообщения
This commit is contained in:
parent
dc7f1cf767
commit
af627cd7b7
6
pom.xml
6
pom.xml
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>dev.struchkov.godfather</groupId>
|
||||
<artifactId>telegram-bot</artifactId>
|
||||
<version>0.0.9</version>
|
||||
<version>0.0.10</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
@ -33,8 +33,8 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<godfather.core.ver>0.0.7</godfather.core.ver>
|
||||
<telegrambots.ver>6.0.1</telegrambots.ver>
|
||||
<godfather.core.ver>0.0.8</godfather.core.ver>
|
||||
<telegrambots.ver>6.1.0</telegrambots.ver>
|
||||
|
||||
<plugin.maven.compiler.ver>3.10.1</plugin.maven.compiler.ver>
|
||||
<plugin.nexus.staging.ver>1.6.13</plugin.nexus.staging.ver>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>dev.struchkov.godfather</groupId>
|
||||
<artifactId>telegram-bot</artifactId>
|
||||
<version>0.0.9</version>
|
||||
<version>0.0.10</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>telegram-core</artifactId>
|
||||
|
@ -2,6 +2,7 @@ package dev.struchkov.godfather.telegram.convert;
|
||||
|
||||
import dev.struchkov.godfather.context.domain.content.Mail;
|
||||
import org.telegram.telegrambots.meta.api.objects.CallbackQuery;
|
||||
import org.telegram.telegrambots.meta.api.objects.User;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ -17,6 +18,10 @@ public class CallbackQueryConvert {
|
||||
mail.setText(callbackQuery.getData());
|
||||
mail.setPersonId(callbackQuery.getMessage().getChatId());
|
||||
mail.setAddDate(LocalDateTime.now());
|
||||
|
||||
final User user = callbackQuery.getFrom();
|
||||
mail.setFirstName(user.getFirstName());
|
||||
mail.setLastName(user.getLastName());
|
||||
return mail;
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ public final class MessageMailConvert {
|
||||
mail.setCreateDate(LocalDateTime.ofInstant(Instant.ofEpochSecond(message.getDate()), ZoneId.systemDefault()));
|
||||
mail.setFirstName(message.getChat().getFirstName());
|
||||
mail.setLastName(message.getChat().getLastName());
|
||||
|
||||
final List<MessageEntity> entities = message.getEntities();
|
||||
if (entities != null) {
|
||||
mail.setAttachments(convertAttachments(entities));
|
||||
|
Loading…
x
Reference in New Issue
Block a user