Skip to content

Commit 24bde58

Browse files
committed
feat: add error metadata as fields
1 parent 2001096 commit 24bde58

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/handlers/error.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,18 @@ impl ValfiskError<'_> {
8686
.description(format!("```\n{:#?}\n```", self.error_or_panic))
8787
.footer(CreateEmbedFooter::new(&self.error_id))
8888
.timestamp(Timestamp::now())
89-
.color(0xef4444);
89+
.color(0xef4444)
90+
.field(
91+
"Command",
92+
format!("`{}`", self.ctx.invoked_command_name()),
93+
false,
94+
)
95+
.field(
96+
"Channel",
97+
format!("<#{}>", self.ctx.channel_id().get()),
98+
false,
99+
)
100+
.field("User", format!("<@{}>", self.ctx.author().id.get()), false);
90101

91102
channel
92103
.send_message(&self.ctx, CreateMessage::new().embed(embed))

0 commit comments

Comments
 (0)