A cleanroom rewrite of Dash on Lightbulb and Hikari.
Changes are documented in the changelog.
Running is easy if you have just and [Nix](https://nixos.org] installed.
direnv, and direnv-nix are also helpful, but not required.
docker load < $(nix build .#dash-container)
# Jump to "Configuration", then run the container the normal way
nix build .#dash
# Jump to "Configuration", then...
./result/bin/dash
Install Poetry.
Copy the file named example.env
in the root of the project to .env
and modify it.
Alternatively, you can also use your hosting platform's method for setting environment variables.
Ensure you have a Discord bot token, then paste it into the DISCORD_TOKEN
key.
Then, obtain a Giphy API token and paste it into the GIPHY_TOKEN
key.
And, finally, run this to run the bot:
poetry install
python3 -m dash
The bot is configured entirely through environment variables. Sample values are provided in extras/example.env
.
MEDIAWIKI_API
and MEDIAWIKI_BASE_URL
control the API URL and the MediaWiki base URL for the MediaWiki extension.
MEDIAWIKI_API
example value: https://ftb.fandom.com/api.php
MEDIAWIKI_BASE_URL
example value: https://ftb.fandom.com/wiki/
Ensure you have a Discord bot token, then set it in the DISCORD_TOKEN
variable.
Then, obtain a Giphy API token and set it in the GIPHY_TOKEN
variable.
A NixOS module is available in flake.nix
, from the nixosModules.default
output.
In your flake.nix
:
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
dash2 = {
url = "github:tomodachi94/dash2";
inputs.nixpkgs.follows = "nixpkgs";
};
# -- snip --
};
# -- snip --
outputs = { nixpkgs, dash2, ... }: {
# -- snip --
nixosConfigurations.my-machine = nixpkgs.lib.nixosSystem {
modules = [
# -- snip --
dash2.nixosModules.default
# -- snip --
# NOTE: Make sure your configuration.nix is loaded somewhere.
];
};
}
And then, in your configuration.nix
:
{
services.dash = {
enable = true;
secretsFile = "/run/secrets/dash"; # See ./extras/example.env for an example of the required format.
};
}
Install Nix, then use nix develop
. If you have direnv
and nix-direnv
installed, you can use direnv allow
and have the shell environment activated automatically.