Skip to content

Commit

Permalink
Missing code block error now uses code blocks itself (#19)
Browse files Browse the repository at this point in the history
The missing code block error now uses code blocks to nicely format the
error message:

## Old output
![Old
output](https://github.com/rust-community-discord/ferrisbot-for-discord/assets/23159282/e08cb1b4-4f86-4a32-ac99-6b4e27381380)

## New output
![New
output](https://github.com/rust-community-discord/ferrisbot-for-discord/assets/23159282/58c166a3-2c82-4777-9d78-2c9cf81a136c)

Co-authored-by: Ivan Borgia Dardi <[email protected]>
  • Loading branch information
ChaiTRex and ivandardi authored May 1, 2024
1 parent 6263afc commit cb0509f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ async fn serenity(#[shuttle_runtime::Secrets] secret_store: SecretStore) -> Shut
let response = if error.is::<poise::CodeBlockError>() {
"\
Missing code block. Please use the following markdown:
\\`code here\\`
`` `code here` ``
or
\\`\\`\\`rust
```ansi
`\x1b[0m`\x1b[0m`rust
code here
\\`\\`\\`"
`\x1b[0m`\x1b[0m`
```"
.to_owned()
} else if let Some(multiline_help) = &ctx.command().help_text {
format!("**{}**\n{}", error, multiline_help)
Expand Down

0 comments on commit cb0509f

Please sign in to comment.