Skip to content

Conversation

@Seraph-coder
Copy link
Owner

No description provided.

Copy link

@vpyzhyanov vpyzhyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

есть замечания

pom.xml Outdated
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scope надо писать в другом месте

pom.xml Outdated

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вместо того, чтобы определять кучу библиотек одной группы можно немного подумать как оптимизировать процесс, притом сделая код более надёжным. Надо посмотреть а есть ли у этих библиотек общий родитель.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

исправил

pom.xml Outdated

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вам похоже было совсем не лень перечислять все)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, исправил


String discordToken = System.getenv("discord_token");
new DiscordBot(discordToken)
new DiscordBot(discordToken, new MarkHandler())
Copy link

@vpyzhyanov vpyzhyanov Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не выполнено требование задачи

И для телеграмма и для дискорда должна использоваться одна и та же обработка сообщений

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

* @see DiscordBot
*
*/
public interface Bot {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

покажите мне место, где вы используете этот интерфейс

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нигде, убрал

*/
public class MarkHandler implements Handler{
/**
* Обработать сообщение от пользователя

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вы нарушаете принцип Барбары Лисков и в целом полиморфизм. Нельзя переопределять описание методов интерфейса. JavaDoc определяется один раз в интерфейсе, остальные методы должны ему строго соответствовать

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

}

/**
* Запустить Телеграмм бота

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И тут

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

*/
@Test
void handleReturnsExpectedResponseWithInputMessage() {
Handler handler = new ru.urfu.MarkHandler();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

замените на нормальный импорт

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

void handleReturnsExpectedResponseWithInputMessage() {
Handler handler = new ru.urfu.MarkHandler();
String inputMessage = "Hello, Bot!";
String expectedResponse = "Ваше сообщение: 'Hello, Bot!'";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в создании этих переменных не особо много смысла. Зато они раздувают очень краткий код до невероятных пределов

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправил

* <br>
* Благодаря этому интерфейсу
* можно реализовать несколько разных обработчиков
* и использовать их в разных ботах, а также менять обработчики,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

С одной стороны это хорошо, но этим вы нарушаете требования задачи. Нужно было одну логику использовать, а вы позволяете где менять везде где только можно, притом независимо

Copy link

@vpyzhyanov vpyzhyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

принято

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants