Closed anon97945 closed 2 years ago
Ig it would be better to add some kind of validator to loader.ConfigValue
. E.g. validator=loader.Boolean
If this would do the same, sure. I think you got my point. 👍🏻 the problem is that you need to check whether the module use yes/no, true/flase, int or whatever. Thatswhy check if default: is an boolean and then apply that validator.
Or make modules able to help your loader by something like possible arguements
[ ] Add validators to loader.ConfigValue
, inc. native ones aka loader.validators.Int, .Boolean etc and custom ones via lambda expressions
Added to local branch, will be added in 1.0.23
loader.validators.Boolean
, loader.validators.Integer
, loader.validators.Choice
[x] My suggestion is related to Hikka userbot itself. It's not about illegal stuff, doesn't violate Telegram EULA and human rights and is not related to modules.
Describe the suggestion .config can apply settings, which is awesome, but it should have some kind of
true
/false
recognition or true/false. Right now i could usetru
oron
and will catch an error than. (example silent_tags.py). It could be checked when the .config saysDefault: False
.Additional context Maybe something like this (or a better one)