use twilight_model::gateway::payload::incoming::MessageCreate as TwilightMessageCreate;
use crate::handle::Handle;
use crate::state::StateBound;
use crate::wrappers::actions::message_create::MessageCreate;
#[derive(Clone)]
pub struct PrefixedContext<State = ()>
where
State: StateBound,
{
pub state: State,
pub event: TwilightMessageCreate,
pub handle: Handle<State>,
pub command_identifier: String,
pub command_prefix: String,
pub command_args: String,
}
impl<State> PrefixedContext<State>
where
State: StateBound,
{
pub fn send(&self, content: impl Into<String>) -> MessageCreate {
self.handle.send(self.event.channel_id, content.into())
}
pub fn reply(&self, content: impl Into<String>) -> MessageCreate {
self.handle
.send(self.event.channel_id, content.into())
.reply(self.event.id)
}
}