Skip to content

Commit

Permalink
Move extension name inside command context key in Sentry
Browse files Browse the repository at this point in the history
- Also add group and parent commands to Slash commands
  • Loading branch information
Galarzaa90 committed May 29, 2024
1 parent e3718dd commit c7b352a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,8 @@ public abstract class MessageCommand<C : MessageCommandContext<C, M>, M : ModalF

mapOf(
"name" to name,
"type" to "message"
)
)

context.sentry.context(
"extension",

mapOf(
"name" to extension.name
"type" to "message",
"extension" to extension.name,
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,11 @@ public abstract class SlashCommand<C : SlashCommandContext<*, A, M>, A : Argumen

mapOf(
"name" to name,
"type" to "slash"
)
)

context.sentry.context(
"extension",

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

context.sentry.breadcrumb(BreadcrumbType.User) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,8 @@ public abstract class UserCommand<C : UserCommandContext<C, M>, M : ModalForm>(

mapOf(
"name" to name,
"type" to "user"
)
)

context.sentry.context(
"extension",

mapOf(
"name" to extension.name
"type" to "user",
"extension" to extension.name,
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,11 @@ public open class ChatCommand<T : Arguments>(

mapOf(
"name" to translatedName,
"type" to "chat"
"type" to "chat",
"extension" to extension.name,
)
)

context.sentry.context(
"extension", extension.name
)

context.sentry.breadcrumb(BreadcrumbType.User) {
category = "command.chat"
message = "Command \"$name\" called."
Expand Down

0 comments on commit c7b352a

Please sign in to comment.