{"id":21223682,"url":"https://github.com/shtrophic/dab-rs","last_synced_at":"2025-07-10T14:30:45.345Z","repository":{"id":58448155,"uuid":"531544406","full_name":"shtrophic/dab-rs","owner":"shtrophic","description":"Announcement Bot for Discord, implemented in Rust","archived":true,"fork":false,"pushed_at":"2024-03-05T13:02:50.000Z","size":675,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T12:18:13.836Z","etag":null,"topics":["announcement","announcement-generator","announcements","bot","chime","discord","discord-bot","linux-app","linux-arm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shtrophic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-01T14:01:05.000Z","updated_at":"2024-10-31T06:55:43.000Z","dependencies_parsed_at":"2023-02-08T19:15:27.508Z","dependency_job_id":"cd79686c-8fbe-497e-bd83-e67e3b82d2d4","html_url":"https://github.com/shtrophic/dab-rs","commit_stats":null,"previous_names":["shtrophic/dab-rs"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/shtrophic/dab-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shtrophic%2Fdab-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shtrophic%2Fdab-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shtrophic%2Fdab-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shtrophic%2Fdab-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shtrophic","download_url":"https://codeload.github.com/shtrophic/dab-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shtrophic%2Fdab-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264590751,"owners_count":23633632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["announcement","announcement-generator","announcements","bot","chime","discord","discord-bot","linux-app","linux-arm"],"created_at":"2024-11-20T22:52:59.365Z","updated_at":"2025-07-10T14:30:44.854Z","avatar_url":"https://github.com/shtrophic.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"200\" height=\"200\" alt=\"dab-rs icon\" src=\"logo.png\"/\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003edab-rs\u003c/h1\u003e\n\n### *Discord Announcement Bot,* implemented in Rust\nA bot that lets users set a chime that is played every time they connect to a channel. Reminiscing that good old \"*User joined your channel*\" from Teamspeak-times; But this time, customizable!\n\n## Features\n\n### Slash-commands\nAfter setting the name of the base command, the following commands will be available:\n```\n/base set url       # sets chime of user to given url (that links to an audio-file)\n/base set file      # sets chime of user to given attachment\n/base clear         # clears chime of user, if present\n/base admin forbid  # sets role whose user's chimes are not played\n```\n### Behaviour\nIf some user connects to a channel, the bot will join that channel and play the chime of the user, if configured. The bot will leave after a configured timespan, if no other user joins.\n\nWhen multiple users connect at the same time, their chimes will be queued and played in FCFS-order, also considering different channels in the same guild.\n\n### Localization\nThis bot is implemented to have full support for localization. This is achieved by using [.ftl](https://projectfluent.org/) resources with [fluent-rs](https://github.com/projectfluent/fluent-rs).\n\n## How to get started\n\n### Packages\nAvailable on the [AUR](https://aur.archlinux.org/packages/dab-rs).\n\n### Compilation\nEnsure that `ffmpeg` and `opus` are installed. The package names to install them on your distro my differ. For arch-based distros, the following commands will get you started:\n\n```console\n$ sudo pacman -S opus ffmpeg cargo \u0026\u0026 git clone https://github.com/Sir-Photch/dab-rs.git \u0026\u0026 cd dab-rs \u0026\u0026 cargo build --release\n```\n\n#### Cross-compile Raspberry Pi \nIf you want to run the bot on a raspberry, you I suggest using the [Cross](https://github.com/cross-rs/cross) toolchain to cross-compile. You can set it up as follows:\n##### Docker\nIf you haven't already set up docker, you can do it as follows:\n```console\n$ sudo pacman -S docker \u0026\u0026 sudo groupadd docker \u0026\u0026 sudo usermod -aG docker $USER\n```\nYou may need to reboot for changes to apply. After that, verify a working docker installation with `docker run hello-world`.\n##### Cross\nAssuming you have the rust toolchain installed.\n```console\n$ cargo install cross\n```\n##### Compilation\nEnsure that `docker.service` is running:\n```console\n$ systemctl start docker\n```\nThen, depending on your raspberry installation, run \n```console\n$ cross build --release --target \u003ctarget\u003e\n```\nFor a RPI4 with a 64-bit kernel, use `aarch64-unknown-linux-gnu`. Note that for cross-compilation, dab-rs statically links to openssl; Updates to your systems `libssl` are not incorporated unless recompiled.\n\n##### Further reading\n- [Docker post-installation](https://docs.docker.com/engine/install/linux-postinstall/)\n- [Cross on github](https://github.com/cross-rs/cross)\n\n### Database\nThis bot needs a database connection to run. Create a database that is to be used and specify the connection details in `Settings.toml`. You do not need to create any tables, this will be ensured at runtime.\n\nYou need to setup a postgres-database though:\n\n```sql\ncreate database dab_rs;\ncreate user INSERT_USERNAME_HERE with password 'INSERT_PASSWORD_HERE';\ngrant all privileges on database dab_rs to INSERT_USERNAME_HERE;\nalter database dab_rs owner to INSERT_USERNAME_HERE;\n```\n\n### Configuration\nThere needs to be a `Settings.toml` inside the directory of the executable. Consider the following template:\n```toml\nUSERDATA_DIR = \"/path/to/userdata/dir\"\nAPI_TOKEN = \"foo bar baz\"\nBUS_SIZE = 200\nCOMMAND_ROOT = \"dab\"\nCHIME_DURATION_MAX_MS = 3000\nFILE_SIZE_LIMIT_KILOBYTES = 5000\nCONNECTION_TIMEOUT_MILLISECONDS = 10000\nRESOURCE_DIR = \"/path/to/resource/dir\"\nDEFAULT_LOCALE = \"en-US\"\nDB_HOSTNAME = \"localhost\"\nDB_USERNAME = \"your username\"\nDB_PASSWORD = \"your password\"\nDB_NAME = \"dab_rs\"\nLOG_PATH = \"/path/to/log.file\"\n```\n- `USERDATA_DIR` specifies the path where the chimes will be saved.\n- `API_TOKEN` is your unique token from discord.\n- `BUS_SIZE` is the queuesize for joins, globally.\n- `COMMAND_ROOT` is the name of the base command. This may be reconfigured, depending on other bots in your guild(s).\n- `CHIME_DURATION_MAX_MS` is the maximum duration of a users chime, in milliseconds.\n- `FILE_SIZE_LIMIT_KILOBYTES` is the maximum size of a users chime on disk, in KB.\n- `CONNECTION_TIMEOUT_MILLISECONDS` is the duration that the bot will remain connected to a channel, after no other user joins a channel in the guild, in milliseconds.\n- `RESOURCE_DIR` is the path to the directory containing the folder structure for localization.\n- `DEFAULT_LOCALE` is the fallback locale that is to be used when translations for a users locale are not available.\n- `DB_*` are the credentials and connection details to the postgresql-database that dab-rs will use.\n- `LOG_PATH` is the file where logs will be saved to.\n\n#### Commandline options\n\n- `-c`, `--config`: specifies path to configuration file \n- `-v`, `--verbose`: enables verbose logging in stdout\n- `-b`, `--beats`: explicitly enables verbose heartbeat logging\n\n### Localization\nBy default, this repository contains translations in [resources](./resources/). To be able to use them, reference this folder in the configuration for your setup. Localizations are dynamically loaded at startup, as long as the folder names obey the [Unicode Language Identifier](https://unicode.org/reports/tr35/tr35.html#Unicode_language_identifier) standards, e.g. `en-US` or `de`.\n\n### Systemd service\nConsider this unit as an example for a systemd-service. Depending on your distro, you may place it in `/etc/systemd/system`:\n```console\ndab-rs.service:\n--------------------------------------\n[Unit]\nDescription=dab-rs Discord Bot\nWants=network-online.target\nRequires=postgresql.service\nAfter=network-online.target postgresql.service\n[Service]\nWorkingDirectory=/path/to/working/directory\nExecStart=/path/to/working/directory/dab-rs\n[Install]\nWantedBy=multi-user.target\n```\nNote that you may need to modify `WorkingDirectory` and `ExecStart` based on your setup.\n\n## Known issues\n\nWon't work on systems with only one CPU-core.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshtrophic%2Fdab-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshtrophic%2Fdab-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshtrophic%2Fdab-rs/lists"}