{"id":33898615,"url":"https://github.com/stackpan/jda-spring-quickstart","last_synced_at":"2026-04-18T21:33:11.189Z","repository":{"id":225179264,"uuid":"765102454","full_name":"stackpan/jda-spring-quickstart","owner":"stackpan","description":"Maven archetype of starter project template for building JDA Discord App with Spring Boot","archived":false,"fork":false,"pushed_at":"2024-05-01T03:44:54.000Z","size":90,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T16:50:38.117Z","etag":null,"topics":["discord-bot-template","java","jda","jda-utilities","maven-archetype","spring-boot"],"latest_commit_sha":null,"homepage":"https://central.sonatype.com/artifact/io.github.stackpan.archetype/jda-spring-quickstart-archetype","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackpan.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":"2024-02-29T09:36:28.000Z","updated_at":"2024-11-27T11:43:01.000Z","dependencies_parsed_at":"2024-05-01T04:35:42.138Z","dependency_job_id":"ceb29407-4d8e-4a0b-b9ca-164f942a10cd","html_url":"https://github.com/stackpan/jda-spring-quickstart","commit_stats":null,"previous_names":["stackpan/jda-spring-quickstart"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/stackpan/jda-spring-quickstart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpan%2Fjda-spring-quickstart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpan%2Fjda-spring-quickstart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpan%2Fjda-spring-quickstart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpan%2Fjda-spring-quickstart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackpan","download_url":"https://codeload.github.com/stackpan/jda-spring-quickstart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpan%2Fjda-spring-quickstart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27564075,"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","status":"online","status_checked_at":"2025-12-07T02:00:07.896Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-bot-template","java","jda","jda-utilities","maven-archetype","spring-boot"],"created_at":"2025-12-11T21:01:01.673Z","updated_at":"2025-12-11T21:01:44.132Z","avatar_url":"https://github.com/stackpan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JDA Spring Quickstart Maven Archetype\n\nStarter project for building JDA Discord bot app with Spring\n\nThis archetype is including these libraries:\n\n- **Spring Framework \u0026 Spring Boot**\n\n  These things can makes your Java programming quicker and easy. [More info](https://spring.io)\n\n- **JDA (Java Discord API)**\n\n  Popular Java wrapper for Discord to build discord bot app. [More info](https://github.com/discord-jda/JDA)\n\n- **BotCommands**\n\n  A JDA command framework (\u0026 much more) which helps to develop your bots faster. [More info](https://github.com/freya022/BotCommands)\n\n- **Project Lombok**\n\n  Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. [More info](https://projectlombok.org)\n\n## Installation\n\nUse Maven Archetype Generator and find archetype with coordinate: `io.github.stackpan.archetype:jda-spring-quickstart-archetype`\n\nDescribed as this command:\n\n```shell\nmvn archetype:generate \\\n  -DarchetypeGroupId=io.github.stackpan.archetype \\\n  -DarchetypeArtifactId=jda-spring-quickstart-archetype \\\n  -DarchetypeVersion={version} \\\n  -DgroupId={your.project.group.id} \\\n  -DartifactId={your-project-artifact-id} \\\n  -Dversion={your-project-version}\n```\n\n## Usage\n\nAfter your project is successfully generated. You will find the following folder structure:\n\n```\nyour-project\n├── mvnw\n├── mvnw.cmd\n├── pom.xml\n└── src\n    └── main\n        ├── java\n        │   └── {package}\n        │       ├── command  // Commands definition and handler\n        │       ├── configuration // Application configurations\n        │       ├── discord  // Additional discord configurations\n        │       ├── service  // Application logic\n        │       └── JdaSpringQuickstartApplication.java  // Main class\n        └── resources\n            └── application.properties\n```\nExample of its uses are provided in the generated project.\n\nFirst thing you must to do is to configure your Discord bot token. Place your token inside `src/main/resource/application.properties` file:\n\n```properties\ndiscord.bot-token=\u003cYOUR_DISCORD_BOT_TOKEN\u003e\n```\n\nTo run the application, use this command:\n```shell\n./mvnw spring-boot:run\n```\n\n### Configuration\n\n#### Bot Token\n\n```properties\n# file: src/main/resource/application.properties\n\ndiscord.bot-token=\u003cYOUR_DISCORD_BOT_TOKEN\u003e\n```\n\n#### JDA Instance\n\nWe have defined `JDA` instance bean configuration inside `{package}.configuration.DiscordConfigurer` class. You can define your own configuration inside `DiscordConfigurer.jda()` bean method configuration:\n\n```java\n// File: src/main/java/{package}/configuration/DiscordConfigurer.java\n\n@Bean\npublic JDA jda() throws InterruptedException {\n  // ...\n}\n```\n\nsee [JDABuilder Javadocs](https://docs.jda.wiki/net/dv8tion/jda/api/JDABuilder.html)\n\n#### Bean Registration\n\nThis archetype uses **freya022/BotCommands** framework to easily manage your bot commands, but this has an issue when injecting your bean from Spring IoC Container into command classes. For example:\n\n```java\n// File: src/main/java/{package}/command/ExampleCommand.java\n\n@CommandMarker\n@RequiredArgsConstructor\npublic class ExampleCommand extends ApplicationCommand {\n\n    private final ExampleService exampleService; // Requires ExampleService as a dependency\n\n    @JDASlashCommand(name = \"ping\", scope = CommandScope.GLOBAL)\n    public void ping(GlobalSlashEvent event) {\n        var message = exampleService.pong();\n        event.reply(message).queue();\n    }\n\n}\n```\n\nWhen you declare your bean inside your `ApplicationCommand` classes, an error will occur when starting the app. This is happened because `ApplicationCommand` classes dependencies cannot resolve your bean dependencies.\n\nTo address this issue, you need to register your bean as command extension from Spring `ApplicationContext` inside `{package}.discord.ExtensionRegister` class:\n\n```java\n// File: src/main/java/{package}/discord/ExtensionRegister.java\n\n@Component\npublic class ExtensionRegister implements Consumer\u003cExtensionsBuilder\u003e, ApplicationContextAware {\n\n    @Setter\n    private ApplicationContext applicationContext;\n    \n    @Override\n    public void accept(ExtensionsBuilder extensionsBuilder) {\n        extensionsBuilder\n                // Registering ExampleService from Spring ApplicationContext, so it can be resolved by ApplicationCommand classes\n                .registerConstructorParameter(ExampleService.class, t -\u003e applicationContext.getBean(ExampleService.class));\n    }\n}\n```\n\nsee [BotCommands/writing-extensions/Constructor-injection](https://freya022.github.io/BotCommands/2.X/writing-extensions/Constructor-injection/)\n\n## Resources\n\n- [Spring.io](https://spring.io)\n- [JDA wiki](https://jda.wiki)\n- [freya022/BotCommands wiki](https://freya022.github.io/BotCommands/2.X/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackpan%2Fjda-spring-quickstart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackpan%2Fjda-spring-quickstart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackpan%2Fjda-spring-quickstart/lists"}