[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10272":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":16,"starSnapshotCount":16,"syncStatus":19,"lastSyncTime":41,"discoverSource":42},10272,"JDA","discord-jda\u002FJDA","discord-jda","Java wrapper for the popular chat & VOIP service: Discord https:\u002F\u002Fdiscord.com","https:\u002F\u002Fjda.wiki",null,"Java",4660,763,66,27,0,4,10,2,30.65,"Apache License 2.0",false,"master",true,[26,27,28,29,30,31,32,33,34,35,36,37],"api","api-wrapper","bot","bot-api","discord","discord-api","java","javadoc","jda","rest","rest-api","websocket","2026-06-12 02:02:19","[maven-central]: https:\u002F\u002Fimg.shields.io\u002Fmaven-central\u002Fv\u002Fnet.dv8tion\u002FJDA?filter=!*-preview*&logo=apachemaven&color=blue\n[jitpack]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSnapshots-JitPack?logo=jitpack\n[installation]: #-installation\n[discord-invite]: https:\u002F\u002Fdiscord.gg\u002F0hMr4ce0tIl3SLv5\n[license]: https:\u002F\u002Fgithub.com\u002Fdiscord-jda\u002FJDA\u002Ftree\u002Fmaster\u002FLICENSE\n[faq]: https:\u002F\u002Fjda.wiki\u002Fintroduction\u002Ffaq\u002F\n[docs]: https:\u002F\u002Fdocs.jda.wiki\u002Findex.html\n[wiki]: https:\u002F\u002Fjda.wiki\u002Fintroduction\u002Fjda\u002F\n[troubleshooting]: https:\u002F\u002Fjda.wiki\u002Fusing-jda\u002Ftroubleshooting\u002F\n[discord-shield]: https:\u002F\u002Fdiscord.com\u002Fapi\u002Fguilds\u002F125227483518861312\u002Fwidget.png\n[faq-shield]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWiki-FAQ-blue.svg\n[docs-shield]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWiki-Docs-blue.svg\n[troubleshooting-shield]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWiki-Troubleshooting-darkgreen.svg\n[license-shield]: https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-white.svg\n[GatewayIntent]: https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FGatewayIntent.html\n[JDABuilder]: https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002FJDABuilder.html\n[DefaultShardManagerBuilder]: https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Fsharding\u002FDefaultShardManagerBuilder.html\n\n\u003Cimg align=\"right\" src=\"https:\u002F\u002Fgithub.com\u002Fdiscord-jda\u002FJDA\u002Fblob\u002Fassets\u002Fassets\u002Freadme\u002Flogo.png?raw=true\" height=\"150\" width=\"150\">\n\n[![maven-central][]][installation]\n[![jitpack][]](https:\u002F\u002Fjitpack.io\u002F#discord-jda\u002FJDA)\n[![license-shield][]][license]\n\n[![discord-shield][]][discord-invite]\n[![faq-shield]][faq]\n[![docs-shield]][docs]\n[![troubleshooting-shield]][troubleshooting]\n\n# JDA (Java Discord API)\n\nThis open source library is intended for implementing bots on Discord using the real-time gateway and REST API. It provides event based functionality to implement bots of any kind, allowing for effective and scalable applications.\n\n## 📖 Overview\n\nThe core concepts of JDA have been developed to make building scalable apps easy:\n\n1. Event System  \n    Providing simplified events from the gateway API, to respond to any platform events in real-time without much hassle.\n1. Rest Actions  \n    Easy to use and scalable implementation of REST API functionality, letting you choose between callbacks with combinators, futures, and blocking.\n    The library also handles rate-limits imposed by Discord automatically, while still offering ways to replace the default implementation.\n1. Customizable Cache  \n    Trading memory usage for better performance where necessary, with sane default presets to choose from and customize.\n\nYou can learn more by visiting our [wiki][wiki] or referencing our [Javadocs][docs].\n\n## 🔬 Installation\n\n[![maven-central][]](https:\u002F\u002Fcentral.sonatype.com\u002Fartifact\u002Fnet.dv8tion\u002FJDA)\n[![jitpack][]](https:\u002F\u002Fjitpack.io\u002F#discord-jda\u002FJDA)\n\nThis library is available on maven central. The latest version is always shown in the [GitHub Release](https:\u002F\u002Fgithub.com\u002Fdiscord-jda\u002FJDA\u002Freleases\u002Flatest).\n\nThe minimum java version supported by JDA is **Java SE 8**. JDA also uses JSR 305 to support solid interoperability with Kotlin out of the box.\n\n> [!NOTE]\n> To use JDA for audio connections, you must also add a dependency that implements the [DAVE Protocol](https:\u002F\u002Fdaveprotocol.com\u002F). See [Making a Music Bot](https:\u002F\u002Fjda.wiki\u002Fusing-jda\u002Fmaking-a-music-bot\u002F) for details.\n\n### Gradle\n\n```gradle\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation(\"net.dv8tion:JDA:$version\") { \u002F\u002F replace $version with the latest version\n      \u002F\u002F Optionally disable audio natives to reduce jar size by excluding `opus-java` and `tink`\n      \u002F\u002F Gradle DSL:\n      \u002F\u002F exclude module: 'opus-java' \u002F\u002F required for encoding audio into opus, not needed if audio is already provided in opus encoding\n      \u002F\u002F exclude module: 'tink' \u002F\u002F required for encrypting and decrypting audio\n      \u002F\u002F Kotlin DSL:\n      \u002F\u002F exclude(module=\"opus-java\") \u002F\u002F required for encoding audio into opus, not needed if audio is already provided in opus encoding\n      \u002F\u002F exclude(module=\"tink\") \u002F\u002F required for encrypting and decrypting audio\n    }\n}\n```\n\n### Maven\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>net.dv8tion\u003C\u002FgroupId>\n    \u003CartifactId>JDA\u003C\u002FartifactId>\n    \u003Cversion>$version\u003C\u002Fversion> \u003C!-- replace $version with the latest version -->\n    \u003C!-- Optionally disable audio natives to reduce jar size by excluding `opus-java` and `tink` -->\n    \u003Cexclusions>\n        \u003C!-- required for encoding audio into opus, not needed if audio is already provided in opus encoding\n        \u003Cexclusion>\n            \u003CgroupId>club.minnced\u003C\u002FgroupId>\n            \u003CartifactId>opus-java\u003C\u002FartifactId>\n        \u003C\u002Fexclusion> -->\n        \u003C!-- required for encrypting and decrypting audio\n        \u003Cexclusion>\n            \u003CgroupId>com.google.crypto.tink\u003C\u002FgroupId>\n            \u003CartifactId>tink\u003C\u002FartifactId>\n        \u003C\u002Fexclusion> -->\n    \u003C\u002Fexclusions>\n\u003C\u002Fdependency>\n```\n\n## 🤖 Creating a Bot\n\nTo use this library, you have to create an Application in the [Discord Application Dashboard](https:\u002F\u002Fdiscord.com\u002Fdevelopers\u002Fapplications) and grab your bot token. You can find a step-by-step guide for this in our wiki page [Creating a Discord Bot](https:\u002F\u002Fjda.wiki\u002Fusing-jda\u002Fgetting-started\u002F#creating-a-discord-bot).\n\n## 🏃‍♂️ Getting Started\n\nWe provide a number of [examples](https:\u002F\u002Fgithub.com\u002Fdiscord-jda\u002FJDA\u002Ftree\u002Fmaster\u002Fsrc\u002Fexamples\u002Fjava) to introduce you to JDA. You can also take a look at our official [Wiki][wiki], [Documentation][docs], and [FAQ][faq].\n\nEvery bot implemented by JDA starts out using the [JDABuilder][JDABuilder] or [DefaultShardManagerBuilder][DefaultShardManagerBuilder]. Both builders provide a set of default presets for cache usage and events it wants to receive:\n\n- `createDefault` - Enables cache for users who are active in voice channels and all cache flags\n- `createLight` - Disables all user cache and cache flags\n- `create` - Enables member chunking, caches all users, and enables all cache flags\n\nWe recommend reading the guide on [caching and intents](https:\u002F\u002Fjda.wiki\u002Fusing-jda\u002Fgateway-intents-and-member-cache-policy\u002F) to get a feel for configuring your bot properly. Here are some possible use-cases:\n\n### Example: Message Logging\n\n> [!NOTE]\n> The following example makes use of the **privileged intent** `GatewayIntent.MESSAGE_CONTENT`, which must be explicitly enabled in your application dashboard. You can find out more about intents in our [wiki guide](https:\u002F\u002Fjda.wiki\u002Fusing-jda\u002Fgateway-intents-and-member-cache-policy\u002F).\n\nSimply logging messages to the console. Making use of [JDABuilder][JDABuilder], the intended entry point for smaller bots that don't intend to grow to thousands of guilds.\n\nStarting your bot and attaching an event listener, using the right [intents][GatewayIntent]:\n\n```java\npublic static void main(String[] args) {\n  JDABuilder.createLight(token, EnumSet.of(GatewayIntent.GUILD_MESSAGES, GatewayIntent.MESSAGE_CONTENT))\n      .addEventListeners(new MessageReceiveListener())\n      .build();\n}\n```\n\nYour event listener could look like this:\n\n```java\npublic class MessageReceiveListener extends ListenerAdapter {\n  @Override\n  public void onMessageReceived(MessageReceivedEvent event) {\n    System.out.printf(\"[%s] %#s: %s\\n\",\n      event.getChannel(),\n      event.getAuthor(),\n      event.getMessage().getContentDisplay());\n  }\n}\n```\n\nYou can find a more thorough example with the [MessageLoggerExample](https:\u002F\u002Fgithub.com\u002Fdiscord-jda\u002FJDA\u002Fblob\u002Fmaster\u002Fsrc\u002Fexamples\u002Fjava\u002FMessageLoggerExample.java) class.\n\n### Example: Slash Command Bot\n\nThis is a bot that makes use of [interactions](https:\u002F\u002Fjda.wiki\u002Fusing-jda\u002Finteractions\u002F) to respond to user commands. Unlike the message logging bot, this bot can work without any enabled intents, since interactions are always available.\n\n```java\npublic static void main(String[] args) {\n  JDA jda = JDABuilder.createLight(token, Collections.emptyList())\n      .addEventListeners(new SlashCommandListener())\n      .build();\n\n  \u002F\u002F Register your commands to make them visible globally on Discord:\n\n  CommandListUpdateAction commands = jda.updateCommands();\n\n  \u002F\u002F Add all your commands on this action instance\n  commands.addCommands(\n    Commands.slash(\"say\", \"Makes the bot say what you tell it to\")\n      .addOption(STRING, \"content\", \"What the bot should say\", true), \u002F\u002F Accepting a user input\n    Commands.slash(\"leave\", \"Makes the bot leave the server\")\n      .setContexts(InteractionContextType.GUILD) \u002F\u002F this doesn't make sense in DMs\n      .setDefaultPermissions(DefaultMemberPermissions.DISABLED) \u002F\u002F only admins should be able to use this command.\n  );\n\n  \u002F\u002F Then finally send your commands to discord using the API\n  commands.queue();\n}\n```\n\nAn event listener that responds to commands could look like this:\n\n```java\npublic class SlashCommandListener extends ListenerAdapter {\n  @Override\n  public void onSlashCommandInteraction(SlashCommandInteractionEvent event) {\n    switch (event.getName()) {\n      case \"say\" -> {\n        String content = event.getOption(\"content\", OptionMapping::getAsString);\n        event.reply(content).queue();\n      }\n      case \"leave\" -> {\n        event.reply(\"I'm leaving the server now!\")\n          .setEphemeral(true) \u002F\u002F this message is only visible to the command user\n          .flatMap(m -> event.getGuild().leave()) \u002F\u002F append a follow-up action using flatMap\n          .queue(); \u002F\u002F enqueue both actions to run in sequence (send message -> leave guild)\n      }\n    }\n  }\n}\n```\n\nYou can find a more thorough example with the [SlashBotExample](https:\u002F\u002Fgithub.com\u002Fdiscord-jda\u002FJDA\u002Fblob\u002Fmaster\u002Fsrc\u002Fexamples\u002Fjava\u002FSlashBotExample.java) class.\n\n## 🚀 RestAction\n\nIn this library, the [RestAction](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html) interface is used as a request builder for all API endpoints.\nThis interface represents a lazy request builder, as shown in this simple example:\n\n```java\nchannel.sendMessage(\"Hello Friend!\")\n  .addFiles(FileUpload.fromData(greetImage)) \u002F\u002F Chain builder methods to configure the request\n  .queue() \u002F\u002F Send the request asynchronously\n```\n\n> [!IMPORTANT]\n> The final call to [`queue()`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#queue%28%29) sends the request.\n> You can also send the request synchronously or using futures, check out our extended guide in the [RestAction Wiki](https:\u002F\u002Fjda.wiki\u002Fusing-jda\u002Fusing-restaction\u002F).\n\nThe RestAction interface also supports a number of operators to avoid callback hell:\n\n- [`map`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#map%28java.util.function.Function%29)  \n    Convert the result of the `RestAction` to a different value\n- [`flatMap`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#flatMap%28java.util.function.Function%29)  \n    Chain another `RestAction` on the result\n- [`delay`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#delay%28java.time.Duration%29)  \n    Delay the element of the previous step\n\nAs well as combinators like:\n\n- [`and`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#and(net.dv8tion.jda.api.requests.RestAction,java.util.function.BiFunction))  \n   Require another RestAction to complete successfully, running in parallel\n- [`allOf`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#allOf(java.util.Collection))  \n   Accumulate a list of many actions into one (see also [`mapToResult`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#mapToResult()))\n- [`zip`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#zip(net.dv8tion.jda.api.requests.RestAction,net.dv8tion.jda.api.requests.RestAction...))  \n   Similar to `and`, but combines the results into a list\n  \n\nAnd configurators like:\n\n- [`timeout`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#timeout(long,java.util.concurrent.TimeUnit)) and [`deadline`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#deadline(long))  \n   Configure how long the action is allowed to be in queue, cancelling if it takes too long\n- [`setCheck`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002FRestAction.html#setCheck(java.util.function.BooleanSupplier))  \n   Running some checks right before the request is sent, this can be helpful when it is in queue for a while\n- [`reason`](https:\u002F\u002Fdocs.jda.wiki\u002Fnet\u002Fdv8tion\u002Fjda\u002Fapi\u002Frequests\u002Frestaction\u002FAuditableRestAction.html#reason(java.lang.String))  \n   The [audit log reason](https:\u002F\u002Fdiscord.com\u002Fdevelopers\u002Fdocs\u002Fresources\u002Faudit-log) for an action\n\n**Example**:\n\n```java\npublic RestAction\u003CVoid> selfDestruct(MessageChannel channel, String content) {\n    return channel.sendMessage(\"The following message will destroy itself in 1 minute!\")\n        .addComponents(ActionRow.of(Button.danger(\"delete\", \"Delete now\"))) \u002F\u002F further amend message before sending\n        .delay(10, SECONDS, scheduler) \u002F\u002F after sending, wait 10 seconds\n        .flatMap((it) -> it.editMessage(content)) \u002F\u002F then edit the message\n        .delay(1, MINUTES, scheduler) \u002F\u002F wait another minute\n        .flatMap(Message::delete); \u002F\u002F then delete\n}\n```\n\nThis could then be used in code:\n\n```java\nselfDestruct(channel, \"Hello friend, this is my secret message\").queue();\n```\n\n## 🧩 Extensions\n\n### [jda-ktx](https:\u002F\u002Fgithub.com\u002FMinnDevelopment\u002Fjda-ktx)\n\nCreated and maintained by [MinnDevelopment](https:\u002F\u002Fgithub.com\u002FMinnDevelopment).  \nProvides [Kotlin](https:\u002F\u002Fkotlinlang.org\u002F) extensions for **RestAction** and events that provide a more idiomatic Kotlin experience.\n\n```kotlin\nfun main() {\n    val jda = light(BOT_TOKEN)\n    \n    jda.onCommand(\"ping\") { event ->\n        val time = measureTime {\n            event.reply(\"Pong!\").await() \u002F\u002F suspending\n        }.inWholeMilliseconds\n\n        event.hook.editOriginal(\"Pong: $time ms\").queue()\n    }\n}\n```\n\nThere are a number of examples available in the [README](https:\u002F\u002Fgithub.com\u002FMinnDevelopment\u002Fjda-ktx\u002F#jda-ktx).\n\n### [Lavaplayer](https:\u002F\u002Fgithub.com\u002Flavalink-devs\u002Flavaplayer)\n\nCreated by [sedmelluq](https:\u002F\u002Fgithub.com\u002Fsedmelluq) and now maintained by the [lavalink community](https:\u002F\u002Fgithub.com\u002Flavalink-devs)  \nLavaplayer is the most popular library used by Music Bots created in Java.\nIt is highly compatible with JDA and Discord4J and allows playing audio from\nYouTube, Soundcloud, Twitch, Bandcamp and [more providers](https:\u002F\u002Fgithub.com\u002Flavalink-devs\u002Flavaplayer#supported-formats).  \nThe library can easily be expanded to more services by implementing your own AudioSourceManager and registering it.\nWe recommend to also use [udpqueue](#udpqueue-an-extension-of-jda-nas) in addition to lavaplayer, to avoid stuttering issues caused by GC pauses.\n\nIt is recommended to read the [Usage](https:\u002F\u002Fgithub.com\u002Flavalink-devs\u002Flavaplayer#usage) section of Lavaplayer\nto understand a proper implementation.  \nSedmelluq provided a demo in his repository which presents an example implementation for JDA:\nhttps:\u002F\u002Fgithub.com\u002Flavalink-devs\u002Flavaplayer\u002Ftree\u002Fmaster\u002Fdemo-jda\n\n### [udpqueue](https:\u002F\u002Fgithub.com\u002FMinnDevelopment\u002Fudpqueue.rs) (an extension of [jda-nas](https:\u002F\u002Fgithub.com\u002Fsedmelluq\u002Fjda-nas))\n\nCreated and maintained by [sedmelluq](https:\u002F\u002Fgithub.com\u002Fsedmelluq) and extended by [MinnDevelopment](https:\u002F\u002Fgithub.com\u002FMinnDevelopment)  \nProvides a native implementation for the JDA Audio Send-System **to avoid GC pauses potentially causing problems** with continuous audio playback.\n\nNote that this send-system creates an extra UDP-Client which causes audio receive to no longer function properly,\nsince Discord identifies the sending UDP-Client as the receiver.\n\n```java\nJDABuilder builder = JDABuilder.createDefault(BOT_TOKEN)\n    .setAudioSendFactory(new NativeAudioSendFactory());\n```\n\n### [Lavalink](https:\u002F\u002Fgithub.com\u002Flavalink-devs\u002FLavalink)\n\nCreated by [Freya Arbjerg](https:\u002F\u002Fgithub.com\u002Ffreyacodes) and now maintained by the [lavalink community](https:\u002F\u002Fgithub.com\u002Flavalink-devs).\n\nLavalink is a popular standalone audio sending node based on Lavaplayer. Lavalink was built with scalability in mind,\nand allows streaming music via many servers. It supports most of Lavaplayer's features.\n\nLavalink is used by many large bots, as well as bot developers who can not use a Java library like Lavaplayer.\nIf you plan on serving music on a smaller scale with JDA, it is often preferable to just use Lavaplayer directly\nas it is easier.\n\n[Lavalink-Client](https:\u002F\u002Fgithub.com\u002FFredBoat\u002FLavalink-Client) is the official Lavalink client for JDA.\n\n## 🛠️ Contributing to JDA\n\nIf you want to contribute to JDA, make sure to base your branch off of our **master** branch (or a feature-branch)\nand create your PR into that **same** branch.\n\nPlease follow our [Contributing Guidelines](https:\u002F\u002Fgithub.com\u002Fdiscord-jda\u002FJDA\u002Fblob\u002Fmaster\u002F.github\u002FCONTRIBUTING.md).\n\nDo not expect your pull request to get immediate attention, sometimes it will take a long time to get a response.\nYou can join our [discord server][discord-invite] and ask in [#lib-dev](https:\u002F\u002Fdiscord.com\u002Fchannels\u002F125227483518861312\u002F869965829024915466) before starting to work on a new PR, to get more immediate feedback from our community members.\n\n## 🚨 Breaking Changes\n\nDue to the nature of the Discord API, the library will regularly introduce breaking changes to allow for a quick adoption of newer features. We try to keep these breaking changes minimal, but cannot avoid them entirely.\n\nMost breaking changes will result in a **minor** version bump (`5.1.2` → `5.2.0`).\n","JDA 是一个用于在 Discord 上实现机器人的 Java 库，它通过实时网关和 REST API 提供了事件驱动的功能。其核心功能包括简化事件处理、易于使用且可扩展的 REST 操作以及可自定义缓存策略，这些设计使得开发者能够轻松构建高效且可扩展的应用程序。此外，JDA 自动管理 Discord 的速率限制，并提供了替换默认行为的方法。此库适用于需要开发与 Discord 平台进行交互的各种规模机器人项目，无论是简单的聊天机器人还是复杂的多服务器管理工具。","2026-06-11 03:27:32","top_topic"]