We have a lot of commands that take as input a date format. At the moment we use function in utils which is good but I think it would be better if we were able to create a custom converter as many disnake types have.
With this approach we don't have to manually parse the time everytime and the global check would catch errors.
:warning: This wont change the discord input field. It would still be plain string.
This is demo of suggested code that would work globally. It is matched by type annotation.
We have a lot of commands that take as input a date format. At the moment we use function in utils which is good but I think it would be better if we were able to create a custom converter as many disnake types have.
Example would be
With this approach we don't have to manually parse the time everytime and the global check would catch errors. :warning: This wont change the discord input field. It would still be plain string.
This is demo of suggested code that would work globally. It is matched by type annotation.
Another way are local converters