Implementation of user-defined annotation converters #191
Sigmanificient
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
This would only be applicable for prefix command btw. Unless for the Application Command we can have stuff like |
Beta Was this translation helpful? Give feedback.
1 reply
-
A implementation using a register binding a Type to a command. There is multiple pros:
from EpikCord import User, Client
client = Client(...)
def user_converter(value):
return CustomThing(value)
client.register_type(user_converter, CustomThing)
# client.register_type(hook=user_converter, annotation=CustomThing)
@client.prefix_command()
async def ping(message, user: CustomThing):
... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The idea behind this feature is to use python typing ability is order to automatically convert a argument passed as string to a custom type with a behavior defined by the user
This discussion is meant to forward idea on the implementation of that feature
Beta Was this translation helpful? Give feedback.
All reactions