Refactor bot client and add group management commands

Replaced ScoreScrapeBotTelegramClient with StoreScrapeBotTelegramClient and updated related references. Added BaseStoreScraperBotCommand for command error handling. Implemented AddGroupCommand and GetGroupCommand for managing allowed groups via admin commands. Improved CouchbaseUtil to ensure scope and collection creation. Updated logging configuration and environment example. Minor model and repository adjustments for initialization and group handling.
This commit is contained in:
2025-11-04 23:06:46 +07:00
parent 774355ee2b
commit bae876b086
16 changed files with 225 additions and 31 deletions
@@ -2,6 +2,7 @@ package com.miti99.storescraperbot;
import com.miti99.storescraperbot.bot.StoreScrapeBot;
import com.miti99.storescraperbot.config.Config;
import com.miti99.storescraperbot.repository.AdminRepository;
import lombok.extern.log4j.Log4j2;
import org.telegram.telegrambots.longpolling.TelegramBotsLongPollingApplication;
@@ -9,6 +10,8 @@ import org.telegram.telegrambots.longpolling.TelegramBotsLongPollingApplication;
public class Main {
public static void main(String[] args) {
AdminRepository.INSTANCE.init();
try (var botsApplication = new TelegramBotsLongPollingApplication()) {
botsApplication.registerBot(Config.TELEGRAM_BOT_TOKEN, StoreScrapeBot.INSTANCE);
log.info("StoreScrapeBot successfully started!");