pub async fn pekofy(ctx: &Ctx, msg: &Message) -> CommandResult {
    let mut reply = CreateMessage::default();

    let (text, embeds) = match get_data(ctx, msg).await? {
        Some((text, embeds)) => (text, embeds),
        None => return Ok(()),
    };

    let mut result = Ok(());

    if let Some(text) = text {
        result = result.and(if text.starts_with("-pekofy") {
            Err(anyhow!("Nice try peko"))
        } else {
            pekofy_text(&text).map(|text| {
                reply.content(text);
            })
        });
    }

    if !embeds.is_empty() {
        result = result.and(pekofy_embeds(msg, &mut reply).await);
    }

    if let Err(e) = result {
        msg.channel_id
            .say(&ctx.http, e.to_string())
            .await
            .context(here!())?;

        return Ok(());
    }

    msg.channel_id
        .send_message(&ctx.http, |_| &mut reply)
        .await
        .context(here!())?;

    Ok(())
}
/// Pekofies replied-to message or the provided text.
Pekofies replied-to message or the provided text.
Pekofies replied - to message or the provided text .
pub async fn pekofy(ctx: &Ctx, msg: &Message) -> CommandResult {
    let mut reply = CreateMessage::default();
    let (text, embeds) = match get_data(ctx, msg).await? {
        Some((text, embeds)) => (text, embeds),
        None => return Ok(()),
    };
    let mut result = Ok(());
    if let Some(text) = text {
        result = result.and(if text.starts_with("-pekofy") {
            Err(anyhow!("Nice try peko"))
        } else {
            pekofy_text(&text).map(|text| {
                reply.content(text);
            })
        });
    }
    if !embeds.is_empty() {
        result = result.and(pekofy_embeds(msg, &mut reply).await);
    }
    if let Err(e) = result {
        msg.channel_id
            .say(&ctx.http, e.to_string())
            .await
            .context(here!())?;
        return Ok(());
    }
    msg.channel_id
        .send_message(&ctx.http, |_| &mut reply)
        .await
        .context(here!())?;
    Ok(())
}
pub async fn pekofy ( ctx : & Ctx , msg : & Message ) -> CommandResult { let mut reply = CreateMessage :: default ( ) ; let ( text , embeds ) = match get_data ( ctx , msg ) . await ? { Some ( ( text , embeds ) ) => ( text , embeds ) , None => return Ok ( ( ) ) , } ; let mut result = Ok ( ( ) ) ; if let Some ( text ) = text { result = result . and ( if text . starts_with ( " " ) { Err ( anyhow ! ( " " ) ) } else { pekofy_text ( & text ) . map ( | text | { reply . content ( text ) ; } ) } ) ; } if ! embeds . is_empty ( ) { result = result . and ( pekofy_embeds ( msg , & mut reply ) . await ) ; } if let Err ( e ) = result { msg . channel_id . say ( & ctx . http , e . to_string ( ) ) . await . context ( here ! ( ) ) ? ; return Ok ( ( ) ) ; } msg . channel_id . send_message ( & ctx . http , | _ | & mut reply ) . await . context ( here ! ( ) ) ? ; Ok ( ( ) ) }
Pekofies replied-to message or the provided text.
Pekofies replied - to message or the provided text .
ctx
&Ctx
msg
&Message
ctx
&Ctx
msg
&Message