Skip to content

context

Context management for Sentry events.

Functions:

Functions

set_user_context

Python
set_user_context(user: User | Member) -> None

Set user context for Sentry events.

set_tag

Python
set_tag(key: str, value: Any) -> None

Set a tag in the current Sentry scope.

set_context

Python
set_context(key: str, value: dict[str, Any]) -> None

Set context data in the current Sentry scope.

set_command_context

Python
set_command_context(ctx: ContextOrInteraction) -> None

Set command context for Sentry events.

track_command_start

Python
track_command_start(command_name: str) -> None

Track command execution start time.

track_command_end

Python
track_command_end(
    command_name: str, success: bool, error: Exception | None = None
) -> None

Track command execution end and performance metrics.

_set_command_context_from_ctx

Python
_set_command_context_from_ctx(ctx: Context[Bot]) -> None

Set context from a command context.

_set_command_context_from_interaction

Python
_set_command_context_from_interaction(interaction: Interaction) -> None

Set context from an interaction.