connectors doesn't seem to do anything
Summary
title
Reproduction Steps
set connectors on an app command constructor
Minimal Reproducible Code
Expected Results
should map that option name to that variable name locally
Actual Results
it doesn't
Intents
0
System Information
irrelevant
Checklist
- [x] I have searched the open issues for duplicates.
- [x] I have shown the entire traceback, if possible.
- [x] I have removed my token from display, if visible.
Additional Context
No response
This is intended, and mentioned in the @slash_command parameter description (this could be improved, though); it's meant to be used in conjunction with options, i.e. only works when completely opting out of the automatic signature parsing.
For instance, you could pass options= with an option named "a", and then have connectors={"a": "b"} to make a (inter, b: str) -> Any command callback work.
Specifying just connectors is basically a no-op, as it doesn't affect command registration. The command still gets registered with the name from the signature, and the connectors mapping then has no effect.
Both this and options have always seemed a little out-of-place in the @slash_command decorator to me, tbqh.
tl;dr, this is arguably a documentation issue
In some cases it is nice to use all of the regular parsing, but have an option with a name that's not allowed in python, eg an option name including a -.
some_name = Param(name="some-name") should work, in that case?
some_name = Param(name="some-name")should work, in that case?
This is unfortunately not very type-safe, as now I'm providing a default which is always present when using the method: disnake doesn't do any replacement to remove that default from the variable.
If we support typing.Annotated, I could use that.
If we support typing.Annotated, I could use that.
On it