running_on_dart
running_on_dart copied to clipboard
Multipurpose bot, primarily built for developing nyxx.
Running on Dart
This is repo for a multipurpose bot, primarily built for developing nyxx - Discord integration for Dart language.
Running
The following environment variables are required to be set for Running on Dart to run:
-
ROD_TOKEN
: The token for the bot account. -
ROD_INTENT_FEATURES_ENABLE
: A bool (true
orfalse
) indicating whether to enable features requiring privileged intents, namelyGUILD_MESSAGES
andGUILD_MEMBERS
. -
ROD_PREFIX
: The prefix to use for text commands. -
ROD_ADMIN_IDS
: The space-separated IDs (snowflakes) of the users that can use administrator commands. -
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_DEV
: A bool (true
orfalse
) indicating whether to run in development mode. -
POSTGRES_PASSWORD
(optional): password of postgres user. -
POSTGRES_USER
: name of postgres user. -
POSTGRES_DB
: name of postgres db. -
DB_HOST
(optional, defaultdb
): host of postgres database -
DB_PORT
(optional, default5432
): port of postgres database -
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
: The GitHub Personal Access Token used to access the GitHub API. -
LAVALINK_ADDRESS
(optional, defaultlavalink
): The address of the lavalink server to connect to. -
LAVALINK_PORT
(optional, default2333
): The port to use to connect to lavalink server. -
LAVALINK_PASSWORD
(optional, defaultyoushallnotpass
): The password to use when connecting to lavalink server. -
LAVALINK_USE_SSL
(optional, defaultfalse
): Whether to use or not ssl to connect to lavalink server.
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.
Standalone
- 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.
With Docker
- Set all the above environment variables in a
.env
file in the project root. - Create a
lavalink.yml
file containing a valid Lavalink configuration. Ensure that the port and password match the associated environment variable. - Run
docker-compose up
to run the bot. If you want to run the bot with metrics, add the-f docker-compose.prod.yaml
option.