Compare commits

..

1 commit

2 changed files with 13 additions and 25 deletions

View file

@ -168,19 +168,12 @@ pub async fn preview(
.await?; .await?;
let faq = faqs.first().expect("FAQ not found"); let faq = faqs.first().expect("FAQ not found");
let embed_description = format_embed_description(&faq.description).expect("Format error");
let embed = CreateEmbed::new() let embed = CreateEmbed::new().title(&faq.title).description(format!(
.title(format!("Title: {}", &faq.title)) "```\n\
.description(format!( {}\n\
"\ ```",
**Raw Text**\n\ &faq.description
```\n\
{}\
```\n\
**Preview:**\n\
{}",
&faq.description, embed_description
)); ));
ctx.send(CreateReply::default().embed(embed)).await?; ctx.send(CreateReply::default().embed(embed)).await?;

View file

@ -88,9 +88,10 @@ pub async fn vibecoded(
format_embed_description(&lock_message.description).expect("Format error"); format_embed_description(&lock_message.description).expect("Format error");
if !comment_option.is_none() { if !comment_option.is_none() {
let comment = comment_option.expect("Comment error"); let comment = comment_option.expect("Comment error");
let formatted_comment = format_embed_description(comment).expect("Format comment error");
let new_description = format!( let new_description = format!(
"{}\n\n**Additional Comment(s)**\n{}", "{}\n\n**Additional Comment(s)**\n{}",
&lock_message.description, comment &lock_message.description, formatted_comment
); );
embed_description = format_embed_description(new_description).expect("Format error"); embed_description = format_embed_description(new_description).expect("Format error");
} }
@ -188,20 +189,14 @@ pub async fn preview(ctx: Context<'_>) -> Result<(), Error> {
.await?; .await?;
let lock_message = lock_messages.first().expect("Lock message not found"); let lock_message = lock_messages.first().expect("Lock message not found");
let embed_description =
format_embed_description(&lock_message.description).expect("Format error");
let embed = CreateEmbed::new() let embed = CreateEmbed::new()
.title(format!("Title: {}", &lock_message.title)) .title(&lock_message.title)
.description(format!( .description(format!(
"\ "```\n\
**Raw Text**\n\ {}\n\
```\n\ ```",
{}\ &lock_message.description
```\n\
**Preview:**\n\
{}",
&lock_message.description, embed_description
)); ));
ctx.send(CreateReply::default().embed(embed)).await?; ctx.send(CreateReply::default().embed(embed)).await?;