You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/cli/cli-database.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,8 +140,8 @@ The exact files vary by ORM but the layout follows the same convention for every
140
140
Once the command finishes, you can inject _DatabaseService_ into any handler, guard, or service within the same module scope. The service is exported from the database module, so importing _DatabaseModule_ in any other module gives you access to it through the DI container.
@@ -129,12 +133,12 @@ The handler class must be decorated with _@ButtonHandler_ and pass the component
129
133
Link buttons open a URL in the user's browser without firing any handler on the bot side. They are useful for directing users to documentation, dashboards, or external tools. Because Discord requires a different button style for links, the _@LinkButton_ decorator omits _customId_ and _style_ in favor of a _url_ field.
@@ -256,10 +260,10 @@ The _style_ field accepts one of four named values that map to Discord's _Button
256
260
Only handler classes need to be registered, and they go in the _handlers_ array of your feature module. Component classes decorated with _@Button_ or _@LinkButton_ are metadata-only and are never added to any module. The dispatcher reads their customId and configuration directly from the class reference stored inside each _@ButtonHandler_ decorator, with no DI instantiation required.
Copy file name to clipboardExpand all lines: en/components/components-context.mdx
+31-31Lines changed: 31 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,11 @@ The flow context system is shared across all component types. A context created
20
20
Inject _ContextService_ into your command or service and call _create_ with the data object you want to thread through the flow. The method returns a _SpraxiumContext_ with a generated UUID, the data, timestamps, and the TTL. You then pass this context to the component service's build method.
content: "Welcome to the setup wizard. Click Next to begin.",
45
+
content: 'Welcome to the setup wizard. Click Next to begin.',
46
46
components: [row],
47
47
});
48
48
}
@@ -116,10 +116,10 @@ The _SpraxiumContext_ object carries both your custom data and operational metad
116
116
Use the _@FlowContext()_ parameter decorator in your handler's _handle_ method to receive the resolved context. The dispatcher extracts the context ID from the _customId_, retrieves the context from the storage adapter, validates expiration and user restrictions, and injects the resolved object. If the context has expired or the user is restricted, the dispatcher replies with the configured error message and does not invoke the handler.
@@ -147,11 +147,11 @@ export class NextStepButtonHandler {
147
147
The _ContextService.update_ method patches the context data without replacing the entire object. This is useful in multi-step flows where each handler adds or modifies a subset of the data. The method returns a boolean indicating whether the update succeeded (context found and not expired).
content: "Step 2 complete. Proceeding to step 3.",
176
+
content: 'Step 2 complete. Proceeding to step 3.',
177
177
ephemeral: true,
178
178
});
179
179
}
@@ -185,11 +185,11 @@ export class StepTwoButtonHandler {
185
185
Call _ContextService.delete_ when the flow is complete or cancelled. This immediately removes the context from the storage adapter. While contexts expire automatically based on TTL, explicit deletion is good practice for flows that complete normally, as it frees storage and prevents stale data from being read in edge cases.
@@ -317,11 +317,11 @@ The default TTL is set in the _defineComponents_ configuration. Individual conte
317
317
The _restrictedTo_ option limits context access to a specific user ID. When set, only interactions from that user ID are dispatched to the handler. Other users who click the component receive the configured _errorMessages.restricted_ message. This is essential for flows where the component is visible to everyone in a channel but should only be actionable by the user who initiated the command.
0 commit comments