-
-
Notifications
You must be signed in to change notification settings - Fork 741
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
Resolve #936 #941
Resolve #936 #941
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm reading this incorrectly, but this PR seems to favor the default TypeReader over any custom TypeReaders a user would have added?
I don't think it would, but it would be worthwhile to test just to be certain. |
@foxbot Only if |
This seems to break overriding of the default type readers at the commandservice registration level and will always take the build in default rather than a newly registered one. I have a custom typereader for IUser (in order to do levensthein distance stuff) which is now no longer called |
#975 will not solve the issue I am facing with this change. I am using my own UserTypeReader which will call the original TypeReader for User (which I get through reflection by calling GetDefaultTypeReader() on CommandService) and only runs my code when the original type reader fails to produce a result.
The reason I am doing this is so I don't have to copy-paste the code from the original type reader. I would prefer to just inherit it so I can just call base.ReadAsync() rather than do this reflection though, it would also make #975 work as proposed. |
Well, you shouldn't be using reflection to get at the internal methods and classes in the first place. I think the best thing to do is to just copy the Also, in the future please use codeblocks for code samples. Reading unformatted code is disgusting. 🤢 |
Why are the typereaders internal anyway? What is the added benefit of it over making them inheritable? |
That is a good question. I also have a scenario where I want to piggyback off of an internal type reader, so maybe we should just open them up. |
* Resolve discord-net#936 * Remember to not search *only* typereaders for primitives 😒
Since #936 has been open for over a week now, I decided to take a stab at this. I'm pretty sure the logic is sound?