{"id":21202362,"url":"https://github.com/taonity/java-discord-help-tree-bot","last_synced_at":"2025-07-10T06:32:37.619Z","repository":{"id":131314470,"uuid":"456133668","full_name":"taonity/java-discord-help-tree-bot","owner":"taonity","description":"The bot that answers questions, configured like tree","archived":false,"fork":false,"pushed_at":"2025-07-03T12:55:17.000Z","size":2105,"stargazers_count":1,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T13:50:51.580Z","etag":null,"topics":["bot","discord","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taonity.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,"zenodo":null}},"created_at":"2022-02-06T11:39:57.000Z","updated_at":"2024-08-03T09:07:07.000Z","dependencies_parsed_at":"2023-12-20T15:04:26.973Z","dependency_job_id":"78998b0d-19fc-43ed-b3cc-8919ba4aad2e","html_url":"https://github.com/taonity/java-discord-help-tree-bot","commit_stats":null,"previous_names":["taonity/java-discord-help-tree-bot"],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/taonity/java-discord-help-tree-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taonity%2Fjava-discord-help-tree-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taonity%2Fjava-discord-help-tree-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taonity%2Fjava-discord-help-tree-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taonity%2Fjava-discord-help-tree-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taonity","download_url":"https://codeload.github.com/taonity/java-discord-help-tree-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taonity%2Fjava-discord-help-tree-bot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264538585,"owners_count":23624436,"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":["bot","discord","java"],"created_at":"2024-11-20T20:15:35.031Z","updated_at":"2025-07-10T06:32:37.332Z","avatar_url":"https://github.com/taonity.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## java-discord-help-tree-bot\nA bot that answers questions using discord SelectMenu\n\n### Features\n- Can be invited in any guild\n- Supports two languages: English and Russian\n- Easy configurable questions and answers in YAML format\n- YAML file management using Gitea \n- Online question tree configuration file updating\n- Error logging\n- Supports backups\n- Supports CI\n\n### Commands\n- `/question` - start question asking session using SelectMenu elements\n- `/channelrole` - give a logging or helping role to the current channel\n- `/config` - get credentials to access the question tree configuration file\n\n### Question tree configuration file\nAfter you join a guild, you can access the question configuration file in Gtiea by admin account or as a user.\nOne node represents a question or answer. All leaves of the tree are answers. All other nodes are questions.\nA question has the following format:\n```\ntext:\n  en: \"question in english1\"\n  ru: \"question in russian1\"\nchildText:\n  - text:\n      en: \"question in english2\"\n      ru: \"question in russian2\"\n  - text:\n      en: \"question in english3\"\n      ru: \"question in russian3\"\n   ...\n```\nAn answer:\n```\ntext:\n  en: \"answer in english1\"\n  ru: \"answer in russian1\"\nfunc: \"function\"\ntargetId: \"idOfdiscordUser\"\n```\nAn answer has two functions:\n- `return_text` - just return the answer text\n- `ask_question` - wait for the user message, then reply to it attaching mention with `idOfdiscordUser`.\n\n### Demo\nSee an example of usage in the demonstration [video](https://www.youtube.com/watch?v=DZdLhIy2Ng4).\n\n### Docker compose project\nThe application can be deployed as a docker-compose project. It consists of the following services:\n- `app` - the java application that runs the discord bot\n- `gitea` - Gitea service that plays a UI role in providing access to the configuration file\n- `db` - postgres database that holds guild settings\n- `flyway` - a tool that runs migrations on the database\n- `make-backup` - [offen/docker-volume-backup](https://github.com/offen/docker-volume-backup) tool to make backups\n- `restore-backup` - [generaltao725/command-runner](https://github.com/taonity/command-runner) tool to run backup restoring scripts\n\n### Prerequirements \nYou can easily run this project on your local machine or server. All you need is a registered [discord application](https://discord.com/developers/applications) and some knowledge of Java, Docker, and Discord.\nAfter you create the app you have to toggle on Server Member Intent and get an invite link with permission code 11005979776 so you can invite your bot in your guild. \n\n### Build\nAs a first part of the build process you have to build the app image:\n```bash\nmvn -P docker clean package -DskipTests\n```\nAfter that, you have to build the docker-compose project that will be placed in `target/docker/test` directory:\n```bash\nmvn -P automation clean package \"-Ddiscord.token=\u003ctoken\u003e\" -DskipTests=true\n```\n### Run\nYou can run the app both on Linux and Windows\n#### Using IntelliJ IDEA (fast)\nYou can run all depending services in the docker compose project:\n```bash\ndocker compose -f target/docker/test/docker-compose-test.yml up gitea db flyway -d\n```\nand the app apart, using IntelliJ. Don't forget to load env var JAVA_DISCORD_HELP_BOT_DISCORD_TOKEN with the token in Run/Debug Configurations.\n\n#### All using docker compose (easy)\n```bash\ndocker compose -f target/docker/test/docker-compose-test.yml up -d\n```\n\n### Test\nThe test is basic and checks if the application starts properly and backup works as expected. It uses testcontainers. To run a test run:\n```bash\nmvn -Dtest=automation.runners.CucumberRunnerIT test\n```\n\n### Deploy\nThe app can be deployed manually or using [generaltao725/docker-webhook](https://github.com/taonity/docker-webhook) tool. \n\n### Backup\nThe backup can be scheduled using docker-volume-backup configurations. There are some manual functionality that are provided by scripts:\n - `target/docker/test/backup/make/scripts/make.sh` - make a backup manually\n - `target/docker/test/backup/restore/scripts/ls.sh` - list all backups\n - `target/docker/test/backup/restore/scripts/restore.sh \u003cbackup_name\u003e` - restore a backup\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaonity%2Fjava-discord-help-tree-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaonity%2Fjava-discord-help-tree-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaonity%2Fjava-discord-help-tree-bot/lists"}