(SR No. 11) Create discord bot and integrate it with event bus #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Discord Bot Integration for Devr.AI
Fixes #di
📌 Summary
This PR adds a Discord bot that integrates with Devr.AI, enabling seamless community engagement, automated event handling, and FAQ responses. The bot listens for key events (messages, reactions, user joins, etc.) and dispatches them via an event bus for further processing.
✨ Features Added
Event Handling
on_message: Captures and processes user messages.on_message_edit: Detects and logs message edits.on_message_delete: Handles message deletions.on_member_join: Triggers onboarding events for new members.on_raw_reaction_add: Captures reactions to messages.Event Bus & Handlers
EventBus: Manages event dispatching for modular processing.HandlerRegistry: Stores registered handlers for different event types.FAQHandler: Detects FAQ queries and responds with predefined answers.MessageHandler: Manages standard message-related events.OnboardingHandler: Sends welcome messages to new users.Duplicate Event Prevention
processed_eventsset to avoid duplicate dispatching.🔧 Fixes & Improvements
channel_idpropagation in event dispatching.fetch_channel()as a fallback ifget_channel()fails.🚀 How to Test
.envfile withDISCORD_BOT_TOKEN.