Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove magic numbers #2

Open
Disinterpreter opened this issue Aug 3, 2020 · 2 comments
Open

Remove magic numbers #2

Disinterpreter opened this issue Aug 3, 2020 · 2 comments

Comments

@Disinterpreter
Copy link
Member

изображение

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

@qaisjp
Copy link
Contributor

qaisjp commented Aug 3, 2020

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

@Disinterpreter
Copy link
Member Author

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.

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

No branches or pull requests

2 participants