Skip to content

[codex] EasyCord v4.1 release#5

Draft
rolling-codes wants to merge 7 commits intomainfrom
codex-easycord-refactor-features
Draft

[codex] EasyCord v4.1 release#5
rolling-codes wants to merge 7 commits intomainfrom
codex-easycord-refactor-features

Conversation

@rolling-codes
Copy link
Copy Markdown
Owner

@rolling-codes rolling-codes commented Apr 23, 2026

This PR carries the EasyCord v4.1 release work into the main branch.

What changed:

  • bumped the package and release docs to v4.1
  • added Cog and GroupCog plus cog registration helpers
  • added extension loading and reloading support
  • added IntegrationPlugin, GuildPlugin, and JsonConfigPlugin helpers
  • added AnnouncementsPlugin and AutoReplyPlugin reference plugins
  • added endpoint decorators for reusable plugin integration points
  • added release automation and fixed release/test workflow dependency installation
  • integrated the approved performance and usability guide from PR docs: add performance and usability guide #27

Validation:

  • pytest: 472 passed
  • python -m compileall easycord examples docs tests
  • python -m build

GitHub release v4.1 has already been published from this branch.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 63bb15e0-2d70-422d-8e16-ee7b77d19346

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex-easycord-refactor-features

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.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 23, 2026

Reviewer's Guide

Introduces a lightweight localization system (LocalizationManager) wired through Bot, Context, and Composer, and leverages it to localize built‑in guard/permission error messages while updating docs, exports, tests, and version metadata for the 3.1.3 release.

Sequence diagram for localized guard error responses via ctx.t and LocalizationManager

sequenceDiagram
  actor User
  participant Discord
  participant Bot
  participant Ctx as Context
  participant LM as LocalizationManager

  User->>Discord: Invoke slash command
  Discord->>Bot: Send interaction
  Bot->>Ctx: Wrap interaction as ctx
  Ctx->>Ctx: Guard checks (guild_only / permissions / cooldown)
  Ctx-->>Bot: Guard fails
  Ctx->>Ctx: t("errors.guild_only", default)
  Ctx->>LM: format(key, locale, guild_locale, default, kwargs)
  LM-->>Ctx: Localized error message
  Ctx->>Discord: respond(ephemeral, content)
  Discord-->>User: Show localized error text
Loading

Class diagram for LocalizationManager integration with Bot, Composer, and Context

classDiagram

class LocalizationManager {
  - str default_locale
  - dict~str, dict~str~ _catalogs
  + __init__(default_locale, translations)
  + register(locale, translations) void
  + locales() list~str~
  + resolve_chain(locale, guild_locale) list~str~
  + get(key, locale, guild_locale, default) str
  + format(key, locale, guild_locale, default, **kwargs) str
}

class Bot {
  + LocalizationManager localization
  + LocalizationManager i18n
  + __init__(intents, auto_sync, localization, default_locale, translations)
}

class Composer {
  - LocalizationManager _localization
  - str _default_locale
  - dict~str, dict~str~ _translations
  + localization(localization) Composer
  + i18n(localization) Composer
  + default_locale(locale) Composer
  + translations(translations) Composer
  + build() Bot
}

class BaseContext {
  + interaction
  + locale
  + guild_locale
  + t(key, default, locale, guild_locale, **kwargs) str
}

Bot *-- LocalizationManager : owns
Composer ..> LocalizationManager : configures
Composer --> Bot : build()
BaseContext ..> LocalizationManager : uses via interaction.client
Loading

File-Level Changes

Change Details Files
Add a reusable localization manager and integrate it with Bot and Context for locale-aware strings.
  • Introduce LocalizationManager helper with locale normalization, fallback chains, lookup, and formatting utilities.
  • Wire Bot.init to create/manage a LocalizationManager instance and expose it as bot.localization and bot.i18n, configurable via constructor args.
  • Expose ctx.locale and ctx.guild_locale from the underlying interaction and add ctx.t(...) to resolve translated strings via the bot's LocalizationManager with safe fallbacks.
  • Export LocalizationManager from the top-level easycord package and document the new localization APIs in the public docs and README.
easycord/i18n.py
easycord/bot.py
easycord/_context_base.py
easycord/composer.py
easycord/__init__.py
docs/api.md
README.md
model.md
Update built-in command guard and permission error messages to use localization instead of hardcoded English strings.
  • Replace literal English error responses in slash command guard logic with ctx.t(...) calls using structured error keys and format parameters.
  • Ensure cooldown and permission-related responses can be translated when a LocalizationManager is configured.
  • Add tests to verify that localized strings are used when a locale/catalog is provided and that sensible defaults remain when no localization manager is present.
easycord/_bot_commands.py
tests/test_bot.py
tests/test_context.py
Extend the Composer to configure localization on constructed Bot instances.
  • Add Composer fields for localization manager instance, default locale, and initial translations mapping.
  • Provide fluent Composer methods .localization()/.i18n(), .default_locale(), and .translations() to seed localization at build time.
  • Ensure Composer.build() forwards localization configuration into the Bot and add tests to confirm default manager creation and translation seeding.
easycord/composer.py
tests/test_composer.py
Update documentation, package metadata, and exports for the 3.1.3 release with localization and validation changes.
  • Revise release notes for version 3.1.3, adding highlights, usage guidance, and updated pytest invocation including new tests.
  • Mention LocalizationManager and ctx.t(...) in the API docs and README, and update feature tables and signatures accordingly.
  • Expose LocalizationManager in package exports and ensure tests assert its presence.
  • Bump project version from 3.1.2 to 3.1.3 in pyproject.toml and update model/roadmap notes to reflect new features.
docs/release-notes.md
docs/api.md
README.md
model.md
pyproject.toml
easycord/__init__.py
tests/test_package_exports.py
tests/test_i18n.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

These three built-in guards were emitting hardcoded English strings
instead of going through the localization system introduced in v3.1.3.
They now use ctx.t() with English defaults matching the prior behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rolling-codes rolling-codes changed the title [codex] EasyCord v3.1.3 feature release [codex] EasyCord v4.1 release Apr 28, 2026
Copy link
Copy Markdown
Owner Author

Triage note: this draft release PR is obsolete/conflicting now that main already contains the v4.1 release work. PR #29 is based on current main and carries the issue fixes plus the requested auto-fix workflow.

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.

2 participants