Configuration
This page will cover the configuration part of the interaction library.
#
Configuring the library for the Botrino frameworkFor the library to work with the Botrino framework, you just need to make sure that your bot module requires botrino.interaction
, and that the interaction
entry is present in your config.json
. The entry has the following structure:
Field | Type | Description | Required? |
---|---|---|---|
application_commands_guild_id | long | The ID of the guild in which commands will be deployed. Specifying null or completely omitting the field will deploy them globally. | No, default null |
default_ack_mode | string | How interactions should be acknowledged by default. Possible values (case insensitive):
| No, default default |
await_component_timeout_seconds | integer | The time in seconds after which InteractionContext::awaitComponentInteraction automatically times out. | No, default 600 |
#
Configuring the library manuallyIf you don't use the framework, the configuration is done via the InteractionConfig
object, which is used to construct InteractionService
:
The methods available in InteractionConfig::builder
are the same as the ones in the JSON described previously.
Once you have the InteractionService
instance, you can register your commands and subscribe to its run()
method:
info
None of this is necessary when using the Botrino framework. Creation of InteractionConfig
and InteractionService
, registration of commands and execution of the run()
method are all done automatically.