How to get a role from a string with the role's id? #2332
Unanswered
NotAYoutuberYT
asked this question in
Q&A
Replies: 1 comment
-
Simply parse the string for the RoleId: let role_id = item.parse::<RoleId>();
match role_id {
Ok(role_id) => role_id,
// you may want to do something else with the error.
Err(e) => return Ok(()),
}; Then call the Alternatively, you can do a http request with the |
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
-
I'm trying to get a role from an ApplicationCommandInteraction's option, but it returns the id as a string. I've tried using Role::convert, but that keeps giving me an error. I've probably missed something very obvious, but I'm tired of looking through documentation and source code. Thanks to anyone who can help!
Beta Was this translation helpful? Give feedback.
All reactions