use crate::serenity_prelude as serenity;
use crate::BoxFuture;
pub trait ContextMenuParameter<U, E> {
fn to_action(
action: fn(
crate::ApplicationContext<'_, U, E>,
Self,
) -> BoxFuture<'_, Result<(), crate::FrameworkError<'_, U, E>>>,
) -> crate::ContextMenuCommandAction<U, E>;
}
impl<U, E> ContextMenuParameter<U, E> for serenity::User {
fn to_action(
action: fn(
crate::ApplicationContext<'_, U, E>,
Self,
) -> BoxFuture<'_, Result<(), crate::FrameworkError<'_, U, E>>>,
) -> crate::ContextMenuCommandAction<U, E> {
crate::ContextMenuCommandAction::User(action)
}
}
impl<U, E> ContextMenuParameter<U, E> for serenity::Message {
fn to_action(
action: fn(
crate::ApplicationContext<'_, U, E>,
Self,
) -> BoxFuture<'_, Result<(), crate::FrameworkError<'_, U, E>>>,
) -> crate::ContextMenuCommandAction<U, E> {
crate::ContextMenuCommandAction::Message(action)
}
}