Skip to content

Commit

Permalink
fix: delete admin marker for logs
Browse files Browse the repository at this point in the history
  • Loading branch information
BulatRuslanovich committed Oct 19, 2024
1 parent 5a5afc3 commit da02f74
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
import com.bipbup.annotation.MessageQualifier;
import com.bipbup.entity.AppUser;
import com.bipbup.enums.AppUserState;
import static com.bipbup.enums.AppUserState.WAIT_BROADCAST_MESSAGE;
import com.bipbup.handlers.StateHandler;
import static com.bipbup.handlers.impl.message.BasicStateHandler.ADMIN_LOG;
import com.bipbup.service.kafka.AnswerProducer;
import com.bipbup.service.db.UserService;
import com.bipbup.service.cache.UserStateCacheService;
import static com.bipbup.utils.CommandMessageConstants.AdminMessageTemplate.MESSAGE_SENT;
import com.bipbup.service.db.UserService;
import com.bipbup.service.kafka.AnswerProducer;
import com.bipbup.utils.HandlerUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.telegram.telegrambots.meta.api.methods.ParseMode;
import org.telegram.telegrambots.meta.api.methods.send.SendMessage;


import static com.bipbup.enums.AppUserState.WAIT_BROADCAST_MESSAGE;
import static com.bipbup.utils.CommandMessageConstants.AdminMessageTemplate.MESSAGE_SENT;

@Slf4j
@Component
@MessageQualifier
Expand Down Expand Up @@ -60,7 +61,7 @@ private void sendMessage(AppUser user, String output) {

private void sendBroadcast(AppUser user, String input) {
var users = userService.getAppUsers();
log.info(ADMIN_LOG, "{} send message to everyone:\n{}", user.getFirstName(), input);
log.info("Admin: {} send message to everyone:\n{}", user.getFirstName(), input);
users.stream().filter(u -> !u.getTelegramId().equals(user.getTelegramId()))
.forEach(u -> sendMessage(u, input));
}
Expand Down

0 comments on commit da02f74

Please sign in to comment.