Replies: 1 comment 2 replies
-
Hey there, similar to your last suggestion, reworking the codebase to adjust the database model as you suggest is a bit out of scope for what this template is supposed to do. This template is supposed to give new developers a head start on their journey as a programmer, not throw them into the cold water with a code level that basically makes it impossible to understand what's going on as a new developer. Best Regards, |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
As a good database option, I would suggest changing the model so that each cog has its own database for users, guilds, and global settings. This can be achieved by initializing the settings in the
__init__
method of each cog, along with a random ID (to prevent duplications when cogs have the same name).Furthermore, settings can be initialized in the
__init__
function, such as global_settings, guild_settings, member_settings, channel_settings, role_settings, etc. These settings can then be retrieved in the cog while using the initialized settings object.Available methods for example are:
await self.settings.guild(guild_ID).parameter_name()
- get the configawait self.settings.guild(guild_ID).parameter_name().set(value)
- set the configThe value can be of type dict, list, string, or int and should be parsed accordingly.
All of this could be implemented in a
db_manager
.I would be happy to help you more with this implementation if you decide to work on it.
Best regards,
entchen.
Beta Was this translation helpful? Give feedback.
All reactions