Closed tazz4843 closed 1 year ago
So, Command would gain a new field pub source_code_name: String
(name up for debate) which is populated with the name of the Rust function which was annotated with #[poise::command]
?
Yeah pretty much
Sure that can be added
On a side note, have you considered using Command.qualified_name as a globally unique identifier for commands?
That's not populated (at least not uniquely) until after the framework starts isn't it? I do translations before the framework touches anything.
That is true. You can manually call set_qualified_names
, though
Still, source_code_name makes sense to add
There's also Command.identifying_name (A string to identify this particular command within a list of commands.
). What do you think of that @tazz4843 ?
I... completely missed that. That works fine for me, but if you want to continue implementing this you can leave this issue open.
I'm working on translating all commands in my bot. Given I have several subcommands with the same name, I want a unique way to refer to each one. I personally have guaranteed that each function is named uniquely, and this would be the perfect unique string to use in translations instead of
poise::Command::name
which doesn't appear to be globally unique across all commands. Let me know if you'd like more of an explanation. Thanks!