Skip to content

Commit

Permalink
merge slash command parent and group names into single key
Browse files Browse the repository at this point in the history
  • Loading branch information
Galarzaa90 committed Jun 6, 2024
1 parent c7b352a commit 5899c34
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,28 @@ public abstract class SlashCommand<C : SlashCommandContext<*, A, M>, A : Argumen
/** If enabled, adds the initial Sentry breadcrumb to the given context. **/
public open suspend fun firstSentryBreadcrumb(context: C, commandObj: SlashCommand<*, *, *>) {
if (sentry.enabled) {
val fullName = buildString {
parentCommand?.let {
append(it.name)
append(" ")
}

parentGroup?.let {
append(it.name)
append(" ")
}

append(name)
}

context.sentry.context(
"command",

mapOf(
"name" to name,
"name" to fullName,
"type" to "slash",
"extension" to extension.name,
"parent" to parentCommand?.name,
"group" to parentGroup?.name,
).filterValues { it != null }
"extension" to extension.name
)
)

context.sentry.breadcrumb(BreadcrumbType.User) {
Expand Down

0 comments on commit 5899c34

Please sign in to comment.