Skip to content
This repository was archived by the owner on Dec 18, 2020. It is now read-only.
This repository was archived by the owner on Dec 18, 2020. It is now read-only.

Remove dependence on static singleton Instance of SisbaseBot #46

Description

@wffirilat

In particular, the areas where SisbaseBot.Instance are currently used are the SMC (being the legacy code that it is), and to access Sisbase infrastructure from commands (which belong to D#+.CommandsNext, and currently have no way to access the bot).

  • The conversion of SMC to a property on each bot instance should be fairly trivial
  • Accessing the "active" sisbase instance from within a command may be harder
    • currently, we are investigating CommandsNext dependency injection as a way to deliver the instance to the command, but it's possible that if D#+ doesn't allow a way to avoid boilerplate while doing this, we will reject that solution and have to find something else. Boilerplate is unacceptable.

Activity

  1. added
    ApprovedThis Issue/PR was approved
    DSPThis issue is related to DsharpPlus
    Improve DSPIssue related to improving DSharpPlus
    on Sep 27, 2020
  2. wffirilat commented on Sep 27, 2020

    @wffirilat
    MemberAuthor

    After investigation, there is no way to avoid boilerplate being required in every command module class when using dependency injection through CommandsNext. As such, that solution, though it would be the right thing to do if it worked, has been rejected.
    Currently, no acceptable alternatives are known. Further investigation is required.

  3. alikindsys commented on Sep 27, 2020

    @alikindsys
    Member

    Boilerplate issues using default cnext dependency injection fixed on DSharpPlus/DSharpPlus#639.
    That solution can now be used.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.0ApprovedThis Issue/PR was approvedDSPThis issue is related to DsharpPlusImportantImprove DSPIssue related to improving DSharpPlusProposal

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions