This is repo for a multipurpose bot, primarily built for developing nyxx - Discord integration for Dart language.
The following environment variables are required to be set for Running on Dart to run:
Core bot settings
ROD_TOKEN
: The token for the bot account.ROD_PREFIX
(optional, defaultn>>
): The prefix to use for text commands.ROD_INTENT_FEATURES_ENABLE
: A bool (true
orfalse
) indicating whether to enable features requiring privileged intents, namelyGUILD_MESSAGES
andGUILD_MEMBERS
.ROD_ADMIN_IDS
: The space-separated IDs (snowflakes) of the users that can use administrator commands.ROD_ADMIN_ID
(optional): Single administrator user ID (snowflake). UseROD_ADMIN_IDS
to provide multiple admins.SYNC_COMMANDS
(optional, defaulttrue
): Whether to sync application commands on startup.ROD_DEBUG
(optional, default0
): Enable extra debug logging (1
/0
ortrue
/false
).ROD_DEV
(optional, defaultfalse
): A bool indicating whether to run in development mode.BOT_NAME
(optional, defaultNataly
): Displayed bot name in some contexts.
Documentation/GitHub settings
ROD_DOCS_UPDATE_INTERVAL
(optional, default900
): The interval, in seconds, between documentation cache updates.ROD_DOCS_PACKAGES
(optional, defaultnyxx nyxx_interactions nyxx_commands nyxx_lavalink nyxx_extensions
): The space-separated names of the packages to include in documentation searches.ROD_DEFAULT_DOCS_RESPONSE
(optional, default can be found insrc/settings.dart
): The content of the message to send when!docs
ordocs info
is run.ROD_DEFAULT_GITHUB_RESPONSE
(optional, default can be found insrc/settings.dart
): The content of the message to send when!github
orgithub info
is run.ROD_GITHUB_ACCOUNT
(optional, defaultnyxx-discord
): The GitHub account to use as the base for repository searches.ROD_GITHUB_TOKEN
(optional): The GitHub Personal Access Token used to access the GitHub API.
Database (PostgreSQL)
DB_HOST
(optional, defaultdb
): Host of postgres database.DB_PORT
(optional, default5432
): Port of postgres database.POSTGRES_USER
(required): Name of postgres user.POSTGRES_DB
(required): Name of postgres db.POSTGRES_PASSWORD
(required): Password of postgres user.
Web server
WEB_SERVER_ENABLE
(optional, default0
): Enable the built-in web server (1
/0
).WEB_SERVER_HOST
(optional, default0.0.0.0
): Host/interface to bind the web server to.WEB_SERVER_PORT
(optional, default8088
): Port for the web server.DISCORD_CLIENT_ID
(optional): Discord OAuth2 application client ID.DISCORD_CLIENT_SECRET
(optional): Discord OAuth2 application client secret.DISCORD_REDIRECT_URI
(optional, defaulthttps://localhost:8088/redirect
): OAuth2 redirect URI.JWT_SECRET
(required when web server or JWT features enabled): Secret used to sign JWTs.
Metrics / Home Assistant (MQTT)
HOME_ASSISTANT_METRICS_MQTT_ENABLED
(optional, default0
): Enable publishing metrics to MQTT (1
/0
).METRICS_MQTT_PATH
(optional, default127.0.0.1
): MQTT broker host or URL.METRICS_MQTT_USERNAME
(optional): MQTT username.METRICS_MQTT_PASSWORD
(optional): MQTT password.
Additionally, if ROD_DEV
is true
, the following environment variables must also be set:
ROD_DEV_GUILD_ID
: The ID (snowflake) of the guild to register commands to when developing.ROD_ADMIN_GUILD
(optional): The ID (snowflake) of the admin guild, if used for admin-scoped features.
- Set all the environment variables above.
- Run
dart pub get
to install dependencies - Run
dart run nyxx_commands:compile -o bot.dart
to generate an executable. - Run the created
bot.exe
file.
- Set all the above environment variables in a
.env
file in the project root. - Run
docker-compose up
to run the bot.
- Set all the above environment variables in a
.env
file in the project root. - Run
make run
to run the bot.