multitheftauto/cogs

Remove magic numbers

Disinterpreter opened this issue · 2 comments

изображение

I think we have to make a config file with an example, and put numbers there.

These magic numbers are actually "unique IDs" - https://docs.discord.red/en/stable/framework_config.html#tutorial

The identifier in Config.get_conf() is used to keep your cog’s data separate from that of another cog, and thus should be unique to your cog. For example: if we have two cogs named MyCog and their identifier is different, each will have its own data without overwriting the other’s data.

So I don't think is suitable for configuration. Although it's actually kind of odd they chose to use a number.

Last I checked they actually support and store it internally as a string anyway, so I wouldn't mind changing this to something like "com.multitheftauto.cogs.wiki" etc

These magic numbers are actually "unique IDs" - https://docs.discord.red/en/stable/framework_config.html#tutorial

Yes. I know.

Last I checked they actually support and store it internally as a string anyway, so I wouldn't mind changing this to something like "com.multitheftauto.cogs.wiki" etc

Sure. We should strive our code better and clearer. And replace the magic numbers is a first step to make it.