Skip to content

Commit bfb710a

Browse files
committed
Associate PartialMember information with provided User within context menu application commands
1 parent 81f6da4 commit bfb710a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/dispatch/slash.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,12 @@ async fn run_command<U, E>(
133133
) {
134134
(
135135
Some(crate::ContextMenuCommandAction::User(action)),
136-
Some(serenity::ResolvedTarget::User(user, _)),
137-
) => action(ctx, (*user).clone()).await,
136+
Some(serenity::ResolvedTarget::User(user, member)),
137+
) => {
138+
let mut user = (*user).clone();
139+
user.member = member.map(|v| Box::new(v.clone()));
140+
action(ctx, user).await
141+
},
138142
_ => return Err(command_structure_mismatch_error),
139143
}
140144
}

0 commit comments

Comments
 (0)