{"id":37016192,"url":"https://github.com/cerus/jda-slash-commands","last_synced_at":"2026-01-14T01:49:01.493Z","repository":{"id":49991366,"uuid":"336107868","full_name":"cerus/jda-slash-commands","owner":"cerus","description":"Slash commands (and message components) for JDA","archived":true,"fork":false,"pushed_at":"2021-06-22T23:11:24.000Z","size":275,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-16T02:19:32.548Z","etag":null,"topics":["discord","discord-api","discord-components","discord-message-components","discord-slash-commands","jda","jda-extension","jda-utilities","message-components","slash-commands"],"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/cerus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"cerus"}},"created_at":"2021-02-04T23:15:00.000Z","updated_at":"2023-01-28T08:09:52.000Z","dependencies_parsed_at":"2022-09-13T08:41:42.264Z","dependency_job_id":null,"html_url":"https://github.com/cerus/jda-slash-commands","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/cerus/jda-slash-commands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerus%2Fjda-slash-commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerus%2Fjda-slash-commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerus%2Fjda-slash-commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerus%2Fjda-slash-commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cerus","download_url":"https://codeload.github.com/cerus/jda-slash-commands/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerus%2Fjda-slash-commands/sbom","scorecard":{"id":271368,"data":{"date":"2025-08-11","repo":{"name":"github.com/cerus/jda-slash-commands","commit":"0cb3e91924d1116809e70800e2c928a2f79cc795"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/maven.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/cerus/jda-slash-commands/maven.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/cerus/jda-slash-commands/maven.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.3.1 not signed: https://api.github.com/repos/cerus/jda-slash-commands/releases/44172073","Warn: release artifact 1.3.0 not signed: https://api.github.com/repos/cerus/jda-slash-commands/releases/44151959","Warn: release artifact 1.2.2 not signed: https://api.github.com/repos/cerus/jda-slash-commands/releases/43810106","Warn: release artifact 1.0.1 not signed: https://api.github.com/repos/cerus/jda-slash-commands/releases/37538147","Warn: release artifact 1.0.1-SNAPSHOT not signed: https://api.github.com/repos/cerus/jda-slash-commands/releases/37440857","Warn: release artifact 1.3.1 does not have provenance: https://api.github.com/repos/cerus/jda-slash-commands/releases/44172073","Warn: release artifact 1.3.0 does not have provenance: https://api.github.com/repos/cerus/jda-slash-commands/releases/44151959","Warn: release artifact 1.2.2 does not have provenance: https://api.github.com/repos/cerus/jda-slash-commands/releases/43810106","Warn: release artifact 1.0.1 does not have provenance: https://api.github.com/repos/cerus/jda-slash-commands/releases/37538147","Warn: release artifact 1.0.1-SNAPSHOT does not have provenance: https://api.github.com/repos/cerus/jda-slash-commands/releases/37440857"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'develop'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T13:27:37.398Z","repository_id":49991366,"created_at":"2025-08-17T13:27:37.398Z","updated_at":"2025-08-17T13:27:37.398Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["discord","discord-api","discord-components","discord-message-components","discord-slash-commands","jda","jda-extension","jda-utilities","message-components","slash-commands"],"created_at":"2026-01-14T01:49:00.986Z","updated_at":"2026-01-14T01:49:01.487Z","avatar_url":"https://github.com/cerus.png","language":"Java","funding_links":["https://github.com/sponsors/cerus"],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://img.shields.io/maven-central/v/dev.cerus/jda-slash-commands)](https://search.maven.org/artifact/dev.cerus/jda-slash-commands) ![GitHub](https://img.shields.io/github/license/cerus/jda-slash-commands) ![GitHub Sponsors](https://img.shields.io/github/sponsors/cerus)\n\n# Notice\nJDA now officially supports interactions (slash commands and buttons) in release 4.3.0. That means that this library will no longer receive updates. \n\n---\n\n\u003cbr\u003e\u003cbr\u003e\n\n# jda-slash-commands\n\n[Slash commands](https://discord.com/developers/docs/interactions/slash-commands) for [JDA](https://github.com/DV8FromTheWorld/JDA)\n\nThis library is only a temporary solution until JDA officially supports slash commands. I decided against contributing to JDA because I don't want to\nmess up their code base.\n\nThis library is also lacking some documentation. If you have any questions feel free to open an issue.\n\n## Features\n\n- Commands\n- Interactions\n- Interactions responses\n- Followup messages\n- Command permissions\n- [Command routers](https://github.com/cerus/jda-slash-commands/wiki/Command-Routers) (Automatically route interactions to your command framework)\n- Message components\n\n## Example\n\nSlash Commands:\n\n```java\npublic class MyBot {\n\n    private static final String BOT_TOKEN = \"********\";\n    private static final String APPLICATION_ID = \"12345654321\";\n\n    public static void main(String[] args) {\n        JDA jda = JDABuilder.setRawEventsEnabled(true).createDefault(BOT_TOKEN).build();\n        initCommands(jda);\n    }\n\n    public void initCommands(JDA jda) {\n        JDASlashCommands.initialize(jda, BOT_TOKEN, APPLICATION_ID);\n        JDASlashCommands.submitGlobalCommand(new CommandBuilder()\n                .name(\"test-command\") // Set command name to '/test-command'\n                .desc(\"My cool test command\")\n                .option(new CommandBuilder.SubCommandGroupBuilder()\n                        .name(\"some-group\") // Specify a group that can hold multiple sub commands\n                        .desc(\"This is a wonderful group\")\n                        .option(new CommandBuilder.SubCommandBuilder()\n                                .name(\"hello\") // Specify sub command 'hello' (/test-command some-group hello)\n                                .desc(\"Greet a user\")\n                                .option(new ApplicationCommandOption(\n                                        ApplicationCommandOptionType.USER,\n                                        \"user\", // Note the lower case name - Names have to be lower case or else things could break\n                                        \"Specify a user to greet\",\n                                        true\n                                ))\n                                .build())\n                        .option(new CommandBuilder.SubCommandBuilder()\n                                .name(\"animal\") // Specify sub command 'animal' (/test-command some-group animal)\n                                .desc(\"Show a animal picture\")\n                                .choices( // Only allow certain values: Cat, Dog and Platypus\n                                        ApplicationCommandOptionType.STRING, // Specify type of the choice: STRING or INTEGER\n                                        \"animal\", // Note the lower case name - Names have to be lower case or else things could break\n                                        \"Specify the animal\",\n                                        new ApplicationCommandOptionChoice(\"Cat\", \"cat\"),\n                                        new ApplicationCommandOptionChoice(\"Dog\", \"cat\"),\n                                        new ApplicationCommandOptionChoice(\"Platypus\", \"platypus\")\n                                )\n                                .build())\n                        .build())\n                .build(), new ApplicationCommandListener() {\n\n            @Override\n            public void onInteraction(final Interaction interaction) {\n                System.out.println(\"We got an interaction! Yay!\");\n            }\n\n        });\n    }\n\n}\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003ePictures\u003c/summary\u003e\n\n![Group](https://i.imgur.com/qL7nL8q.png)\n\n![Animal](https://i.imgur.com/qm8xLI6.png)\n\n![Hello](https://i.imgur.com/5JMolqh.png)\n\n![Hello Response](https://i.imgur.com/bXng3nG.png)\n\n![Animal Response](https://i.imgur.com/6sEOMBk.png)\n\n\u003c/details\u003e\n\nMessage components:\n\n```java\npublic class MyBot {\n\n    private static final String BOT_TOKEN = \"********\";\n    private static final String APPLICATION_ID = \"12345654321\";\n\n    public static void main(String[] args) {\n        JDA jda = JDABuilder.setRawEventsEnabled(true).createDefault(BOT_TOKEN).build();\n        initCommands(jda);\n    }\n\n    public void initCommands(JDA jda) {\n        JDASlashCommands.initialize(jda, BOT_TOKEN, APPLICATION_ID);\n\n        // Add a component listener that will get called\n        // every time a component is clicked\n        JDASlashCommands.addComponentListener(interaction -\u003e {\n            final Component clickedComponent = interaction.getClickedComponent();\n            if (clickedComponent instanceof Button) {\n                final Button button = clickedComponent.cast();\n                interaction.respond(\"You clicked \" + button.getLabel() + \"!\");\n            }\n        });\n\n        // Add a one time component listener that will \n        // get called when a button with the provided \n        // button id is clicked\n        JDASlashCommands.addOneTimeComponentListener(\"my_btn\", interaction -\u003e {\n            final Component clickedComponent = interaction.getClickedComponent();\n            final Button button = clickedComponent.cast();\n            interaction.respond(\"You clicked \" + button.getLabel() + \"!\");\n        });\n\n        // Create an example command and respond to \n        // interactions with message components\n        JDASlashCommands.submitGlobalCommand(new CommandBuilder()\n                .name(\"test\")\n                .desc(\"Test command\")\n                .build(), interaction -\u003e {\n            interaction.respond(\"Available actions:\", Arrays.asList(\n                    ActionRow.of(\n                            Button.normalButton(Button.Style.PRIMARY, \"Action 1\", \"my_btn\"),\n                            Button.normalButton(Button.Style.SECONDARY, \"Action 2\", \"my_btn_0\"),\n                            Button.normalButton(Button.Style.DANGER, \"Action 3\", \"my_btn_1\"),\n                            Button.normalButton(Button.Style.SUCCESS, \"Action 4\", \"my_btn_2\")\n                    ),\n                    ActionRow.of(\n                            Button.emojiButton(Button.Style.SUCCESS, \"Emoji!\", \"my_btn_3\",\n                                    Button.PartialEmoji.getDefaultEmoji(\"❤️\")),\n                            Button.emojiButton(Button.Style.DANGER, \"Another emoji!\", \"my_btn_4\",\n                                    Button.PartialEmoji.getEmojiFromEmote(jda.getEmoteById(850779306803986442L)))\n                            //\n                            // Link buttons seem to be broken at the moment\n                            //\n                            //Button.emojiLinkButton(Button.Style.DANGER, \"Emoji with link!\", \"https://cerus.dev\",\n                            //        Button.PartialEmoji.getDefaultEmoji(\"✨\")),\n                            //Button.linkButton(Button.Style.SECONDARY, \"Link!\", \"https://discord.com\")\n                    )\n            ));\n        });\n    }\n\n}\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003ePictures\u003c/summary\u003e\n\n![Img 1](https://i.imgur.com/xlg2hYm.png)\n\n![Img 2](https://i.imgur.com/vpGX60r.png)\n\n\u003c/details\u003e\n\n## Installation\n\nSince version 1.2.2, you can install `jda-slash-commands` from the central repository.\n\n\u003cdetails\u003e\n  \u003csummary\u003eBefore 1.2.2\u003c/summary\u003e\n\n**Maven**\n\n``` xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\t\n\u003c!--Replace TAG with the version--\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.cerus\u003c/groupId\u003e\n    \u003cartifactId\u003ejda-slash-commands\u003c/artifactId\u003e\n    \u003cversion\u003eTag\u003c/version\u003e\n\u003c/dependency\u003e\n\n```\n\n**Gradle**\n\n```\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n\ndependencies {\n    implementation 'com.github.cerus:jda-slash-commands:TAG'\n}\n\n```\n\n\u003c/details\u003e\n\n**Maven**\n\n```xml\n\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003edev.cerus\u003c/groupId\u003e\n        \u003cartifactId\u003ejda-slash-commands\u003c/artifactId\u003e\n        \u003cversion\u003e1.3.1\u003c/version\u003e \u003c!-- Replace with latest version --\u003e\n        \u003cscope\u003ecompile\u003c/scope\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n**Gradle**\n\n```\nallprojects {\n    repositories {\n        ...\n        mavenCentral()\n    }\n}\n\ndependencies {\n    implementation 'dev.cerus:jda-slash-commands:1.3.1'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcerus%2Fjda-slash-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcerus%2Fjda-slash-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcerus%2Fjda-slash-commands/lists"}