Kord Extensions Help

Extensions

The extensions builder allows you to register extensions, and configure bundled and third-party extensions.

ExtensibleBot(TOKEN) { // ... extensions { add(::MyExtension) extMyExtension() help { pingInReply = false color { DISCORD_BLURPLE } } sentry { enable = true dsn = "abc123" } } }

Builders

Builder

Receiver

Description

add

Register an extension to be loaded via a callable object (usually a constructor) that returns an implementation of the Extension type.

help

HelpExtensionBuilder

Configure the currently loaded help extension, and enable or disable the bundled one.

sentry

SentryExtensionBuilder

Configure the Kord Extensions Sentry extension and integration.

Help Extension

The help builder allows you to configure the currently loaded chat command help extension, and enable or disable the bundled one.

Builders

Builder

Receiver

Description

colo(u)r

MessageCreateEvent

Register a callback that returns a Color object to use for display in help embeds. Will be called for every embed generated.

check

ChatCommandCheck

Register a check that must pass for help commands to be executed.

Properties

Name

Type

Default

Description

deleteInvocationOnPaginatorTimeout

Boolean

false

Whether to delete the message containing the help command invocation once the paginator timeout has been reached.

deletePaginatorOnTimeout

Boolean

false

Whether to delete the paginator output by the help command after the paginator timeout has been reached.

enableBundledExtension

Boolean

true

Whether to enable the bundled help extension.

paginatorTimeout

Long

60

How long since the user's last button press to wait before the help paginator times out, in seconds.

pingInReply

Boolean

true

Whether to mention (ping) users in reply to their help command invocation.

Sentry Extension

The sentry builder is used to configure the Sentry integration, as well as enabling or disabling the bundled extension used for collecting feedback from users when errors occur.

Builders

Builder

Receiver

Description

builder

Register a callable object (usually a constructor) that returns an alternative implementation of the SentryAdapter type.

defaultDataTypes

SentryDataTypeBuilder

Configure the default data types that Kord Extensions is allowed to send to Sentry in breadcrumbs and exception reports. This is done by setting the relevant Boolean properties that are exposed on the provided SentryDataTypeBuilder object.

dataTypeTransformer

SentryDataTypeBuilder.(SentryCapture)

Register a Sentry data type transformer, allowing you to change the types of data that may be submitted to Sentry based on the given SentryCapture object.

Data type transformers are run before Kord Extensions adds the data defined in the SentryCapture object's properties is added to the relevant Sentry object.

predicate

SentryCapture

Register a Sentry submission predicate, allowing you to prevent the data in the given SentryCapture object from being submitted to Sentry by returning false.

Sentry submission predicates are run just before Kord Extensions attempts to submit the data defined in the SentryCapture object to Sentry, and thus runs after the relevant data has been sanitized and processed.

setup

SentryAdapter

Replace the bundled setup callback with your own function, which must configure the SentryAdapter by calling its init function. This should only be used if you need to customize precisely what gets passed to that function.

Properties

The following properties are used to configure the Kord Extensions Sentry integration, rather than the Sentry API itself.

Name

Type

Default

Description

enable

Boolean

false

Whether to enable the Kord Extensions Sentry integration.

feedbackExtension

Boolean

false

Whether to enable the bundled Sentry feedback extension, which adds feedback chat and slash commands, and provides error IDs with messages for errors submitted to Sentry, which users can use with the commands to submit feedback for.

pingInReply

Boolean

true

Whether to ping users in response to their feedback chat command invocations.

sampleRate

Double

1.0

How many submitted events to send to Sentry, as a percentage. 1.0 means all events, 0.1 means 10% of the events, and so on.

The following properties are used to configure the Sentry API directly. Only the most common options are exposed here, but you can use the setup builder if you need to configure other options. For more information, see the Sentry documentation.

Name

Type

Default

Description

debug

Boolean

false

Whether to enable Sentry's debug mode.

dsn

String?

null

Your Sentry DSN, required to enable the integration.

distribution

String?

null

Sentry's Distribution option.

environment

String?

null

Sentry's Environment option.

release

String?

null

Sentry's Release option.

serverName

String?

null

Sentry's Server Name option.

Last modified: 20 November 2024