Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xen0xys/discord-java-lib
https://github.com/xen0xys/discord-java-lib
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/xen0xys/discord-java-lib
- Owner: Xen0Xys
- License: gpl-3.0
- Created: 2023-01-09T12:52:10.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-14T09:48:10.000Z (over 1 year ago)
- Last Synced: 2024-12-16T13:16:33.323Z (25 days ago)
- Language: Java
- Size: 52.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord-Java-Lib
A Java library for creating Discord bots using the JDA library.
## Prerequisites
Before you can use this library, you need to have the following installed:
- Java 17 or higher
- Maven## Installation
To use this library in your project, you can include it as a dependency in your Maven project by adding the following to your `pom.xml`:
```xml
fr.xen0xys
discord-java-lib
0.1.1-beta
```
## Usage
To use this library, you need to create a new instance of the DiscordBot class and use its run() method to start the bot.Here is an example of how to use this library to create a simple "echo" bot that repeats everything that is said in the chat:
```java
import com.example.discord.DiscordBot;public class MyBot {
public static void main(String[] args) {
DJBot bot = new DJBot("token");
}
}
```To customize the behavior of your bot, you can use the onMessageReceived() method to register a callback that will be called every time a message is received.
Here is an example of how to modify the above example to implement the "echo" behavior:
For more information on how to customize your bot's behavior, please refer to the documentation for the JDA library.
## License
This library is licensed under the GPL-3.0 License. See the LICENSE file for more details.