File tree Expand file tree Collapse file tree
crates/rustmail/src/commands/add_reminder/text_command Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,16 +160,20 @@ async fn parse_roles_and_content(
160160 let mut all_roles_valid = !potential_role_names. is_empty ( ) ;
161161
162162 for role_name in & potential_role_names {
163+ let role_id = role_name
164+ . chars ( )
165+ . filter ( |c| c. is_ascii_digit ( ) )
166+ . collect :: < String > ( ) ;
167+
163168 if role_name. is_empty ( ) {
164169 all_roles_valid = false ;
165170 break ;
166171 }
167172
168173 let role_name_lower = role_name. to_lowercase ( ) ;
169- let found = guild
170- . roles
171- . values ( )
172- . find ( |r| r. name . to_lowercase ( ) == role_name_lower) ;
174+ let found = guild. roles . values ( ) . find ( |r| {
175+ r. name . to_lowercase ( ) == role_name_lower || r. id . get ( ) . to_string ( ) == * role_id
176+ } ) ;
173177
174178 if let Some ( role) = found {
175179 found_role_ids. push ( role. id . get ( ) ) ;
You can’t perform that action at this time.
0 commit comments