siscodeorg / sisbase

An easy to use discord bot base for D#+. Discord Link :
https://discord.gg/ycvm6xJ
MIT License
1 stars 0 forks source link

Remove dependence on static singleton Instance of SisbaseBot #46

Open wffirilat opened 4 years ago

wffirilat commented 4 years ago

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).

wffirilat commented 4 years ago

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.

alikindsys commented 4 years ago

Boilerplate issues using default cnext dependency injection fixed on https://github.com/DSharpPlus/DSharpPlus/pull/639. That solution can now be used.