Skip to content

Commit 1cb2f58

Browse files
committed
Associate PartialMember information with provided User within context menu application commands
1 parent 2c99507 commit 1cb2f58

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
@@ -127,8 +127,12 @@ async fn run_command<U, E>(
127127
) {
128128
(
129129
Some(crate::ContextMenuCommandAction::User(action)),
130-
Some(serenity::ResolvedTarget::User(user, _)),
131-
) => action(ctx, (*user).clone()).await,
130+
Some(serenity::ResolvedTarget::User(user, member)),
131+
) => {
132+
let mut user = (*user).clone();
133+
user.member = member.map(|v| Box::new(v.clone()));
134+
action(ctx, user).await
135+
},
132136
_ => return Err(command_structure_mismatch_error),
133137
}
134138
}

0 commit comments

Comments
 (0)