Skip to content

Commit 62039f9

Browse files
committed
feat(settings): integrate settings handlers into main application
- Added settings handlers to manage group settings within the bot. - Updated the application initialization process to include new settings handlers alongside existing handlers. - Enhanced the bot's functionality by incorporating rules URL from settings for improved user guidance.
1 parent 8dc8786 commit 62039f9

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/python_italy_bot/main.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .db import create_repository
99
from .handlers.id import create_id_handlers
1010
from .handlers.moderation import create_moderation_handlers
11+
from .handlers.settings import create_settings_handlers
1112
from .handlers.spam import create_spam_handler
1213
from .handlers.welcome import create_welcome_handlers
1314
from .services.captcha import CaptchaService
@@ -30,6 +31,7 @@ async def _post_init(application) -> None:
3031
repository,
3132
secret_command=settings.captcha_secret_command,
3233
file_path=settings.captcha_file_path,
34+
rules_url=settings.rules_url,
3335
)
3436
moderation_service = ModerationService(repository)
3537
spam_detector = SpamDetector()
@@ -39,13 +41,15 @@ async def _post_init(application) -> None:
3941
application.bot_data["moderation_service"] = moderation_service
4042
application.bot_data["spam_detector"] = spam_detector
4143

42-
for handler in create_welcome_handlers(captcha_service):
44+
for handler in create_id_handlers():
45+
application.add_handler(handler)
46+
for handler in create_settings_handlers():
4347
application.add_handler(handler)
44-
application.add_handler(create_spam_handler(spam_detector))
4548
for handler in create_moderation_handlers(moderation_service):
4649
application.add_handler(handler)
47-
for handler in create_id_handlers():
50+
for handler in create_welcome_handlers(captcha_service):
4851
application.add_handler(handler)
52+
application.add_handler(create_spam_handler(spam_detector))
4953

5054

5155
async def _post_shutdown(application) -> None:

0 commit comments

Comments
 (0)