Skip to content

Commit bfd8c6e

Browse files
committed
feat: hardcoded blocklist
1 parent 4e3a96b commit bfd8c6e

File tree

1 file changed

+10
-0
lines changed
  • src/main/java/com/example/cardiotelegrambot/service/bot/main

1 file changed

+10
-0
lines changed

src/main/java/com/example/cardiotelegrambot/service/bot/main/BotService.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import org.springframework.beans.factory.annotation.Qualifier;
1010
import org.springframework.stereotype.Service;
1111

12+
import java.util.ArrayList;
13+
import java.util.List;
14+
1215
@Service
1316
public class BotService {
1417

@@ -17,18 +20,25 @@ public class BotService {
1720
private final Command command;
1821
private final Logger logger;
1922

23+
// TODO temporary solution
24+
private final List<Long> blocked;
25+
2026
@Autowired
2127
public BotService(@Qualifier("mainBotBean") TelegramBot bot, Button button, Command command, Logger logger) {
2228
this.bot = bot;
2329
this.button = button;
2430
this.command = command;
2531
this.logger = logger;
32+
33+
this.blocked = new ArrayList<>();
34+
this.blocked.add(5733496893L);
2635
}
2736

2837
public void startBot() {
2938
bot.setUpdatesListener(updates -> {
3039
try {
3140
for (Update update : updates) {
41+
if (blocked.contains(update.message().chat().id())) continue;
3242
if (update.callbackQuery() != null) executeButton(update);
3343
else if (update.message() != null) executeCommand(update);
3444
}

0 commit comments

Comments
 (0)