Skip to content

Conversation

@adot-7
Copy link

@adot-7 adot-7 commented Dec 14, 2025

Closes #185

Description

This PR removes dependency conflicts which cause errors when starting the backend as seen in #185.

Changes Made

  1. Removed py-cord from dependency specifications which allowed discord.py to be imported.

  2. Ensured discord.py is the sole Discord library resolved at runtime to avoid those dependency conflicts (which I think are the reason of errors in BUG: Backend fails to start on fresh install due to Discord dependency mismatch #185 )

  3. Updated Discord extension error handling to use discord.errors.ExtensionFailed instead of commands.ExtensionError.

✅ Checklist

  • I have read the contributing guidelines.
  • [] I have added tests that prove my fix is effective or that my feature works.
  • [] I have added necessary documentation (if applicable).
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated Discord library imports and error handling mechanisms.
    • Removed unused dependency from project configuration files.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 14, 2025

Walkthrough

Removed py-cord dependency from requirements and updated exception handling in the Discord bot startup code to use discord.errors.ExtensionFailed instead of the non-existent commands.ExtensionError, resolving version compatibility issues during backend initialization.

Changes

Cohort / File(s) Summary
Discord module imports and error handling
backend/main.py
Replaced import from discord.ext import commands with from discord import errors as discord_errors; updated exception handler to catch discord_errors.ExtensionFailed instead of commands.ExtensionError
Dependency removal
backend/requirements.txt, pyproject.toml
Removed py-cord==2.6.2 from requirements.txt and py-cord from pyproject.toml dependencies list

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify that discord.py is properly specified in dependencies and provides the discord.errors.ExtensionFailed exception
  • Confirm that removing py-cord does not conflict with or replicate functionality already available in discord.py
  • Ensure the exception handling change correctly addresses the reported startup failure

Poem

🐰 The discord's ExtensionError, it vanished one day,
So we caught ExtensionFailed in the proper way,
Removed py-cord's ghost from our dependency store,
Now the bot boots fresh without any more roar! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: removing py-cord dependency and fixing Discord error handling to resolve startup crashes.
Linked Issues check ✅ Passed The PR directly addresses issue #185 by removing py-cord to eliminate dependency conflicts and updating error handling to catch discord.errors.ExtensionFailed instead of commands.ExtensionError.
Out of Scope Changes check ✅ Passed All changes are directly scoped to resolving issue #185: dependency removal from requirements.txt and pyproject.toml, and error handling correction in main.py.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8eeacad and 75f7da8.

📒 Files selected for processing (3)
  • backend/main.py (2 hunks)
  • backend/requirements.txt (0 hunks)
  • pyproject.toml (0 hunks)
💤 Files with no reviewable changes (2)
  • backend/requirements.txt
  • pyproject.toml
🔇 Additional comments (1)
backend/main.py (1)

49-52: Exception type update aligns with PR objective, but depends on correct import.

The change from commands.ExtensionError (which doesn't exist) to ExtensionFailed addresses the AttributeError mentioned in issue #185. The error handling strategy—catching exceptions, logging, and continuing—allows the backend to start even if the Discord integration fails, which provides good resilience.

However, this fix depends on line 16 importing ExtensionFailed from the correct module. Please verify the import path as noted in the previous comment.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Backend fails to start on fresh install due to Discord dependency mismatch

1 participant