Skip to content

Commit a1ee1f3

Browse files
committed
refactor(main): comment out spam handler and detector initialization
- Removed the spam handler and detector from the main application initialization to streamline the bot's functionality. - Updated the application data structure to reflect these changes, ensuring no references to the spam components remain active.
1 parent 57c8708 commit a1ee1f3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/python_italy_bot/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
from .handlers.moderation import create_moderation_handlers
1212
from .handlers.ping import create_ping_handlers
1313
from .handlers.settings import create_settings_handlers
14-
from .handlers.spam import create_spam_handler
14+
# from .handlers.spam import create_spam_handler
1515
from .handlers.welcome import create_welcome_handlers
1616
from .services.captcha import CaptchaService
1717
from .services.moderation import ModerationService
18-
from .services.spam_detector import SpamDetector
18+
# from .services.spam_detector import SpamDetector
1919

2020
logging.basicConfig(
2121
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
@@ -36,12 +36,12 @@ async def _post_init(application) -> None:
3636
rules_url=settings.rules_url,
3737
)
3838
moderation_service = ModerationService(repository)
39-
spam_detector = SpamDetector()
39+
# spam_detector = SpamDetector()
4040

4141
application.bot_data["repository"] = repository
4242
application.bot_data["captcha_service"] = captcha_service
4343
application.bot_data["moderation_service"] = moderation_service
44-
application.bot_data["spam_detector"] = spam_detector
44+
# application.bot_data["spam_detector"] = spam_detector
4545

4646
for handler in create_id_handlers():
4747
application.add_handler(handler)
@@ -55,7 +55,7 @@ async def _post_init(application) -> None:
5555
application.add_handler(handler)
5656
for handler in create_ping_handlers(settings):
5757
application.add_handler(handler)
58-
application.add_handler(create_spam_handler(spam_detector))
58+
# application.add_handler(create_spam_handler(spam_detector))
5959

6060

6161
async def _post_shutdown(application) -> None:

0 commit comments

Comments
 (0)