You can invite the bot to your own server using the following link:
JavaBot is a simple yet powerful Discord bot built using Java and the JDA library. It includes several commands such as greeting users, chatting with an AI, providing user info, and more! This bot is designed to be easily customizable and deployable.
- Slash Commands: The bot supports multiple commands such as
/hello,/chat,/ping,/user,/help, and more. - Abusive Language Detection: The bot filters abusive language and can take action like warning or kicking users.
- Customizable AI Integration: Integrated with Grok API for intelligent responses.
- User Info Retrieval: Fetches user info like online status, name, and avatar.
- Easy Deployment: Simple deployment on platforms like Railway.
/hello: Say hello to the bot./chat [prompt]: Chat with the bot using an AI model./user [username]: Get user information in the server./ping: Check the bot's latency./help: Display help message with all available commands./info: Display information about the bot./define [word]: Get the definition of any word.
- Java 17 or later
- Maven or Gradle for dependency management
- Discord Developer Account to create a bot and get the token
- Grok API Key (for AI-related features)
-
Clone the repository:
git clone https://github.com/sparshsinghal885/Discord-Bot.git cd Discord-Bot -
Create a
.envfile in the root of the project and add the following values:DISCORD_TOKEN=your-discord-bot-token-here GROK_API_KEY=your-grok-api-key-here
-
Build the project using Maven or Gradle:
For Maven:
mvn clean install
For Gradle:
./gradlew build
-
Run the bot:
java -jar target/your-bot.jar
- Push your code to GitHub.
- Create a new project on Railway.
- Link your GitHub repository.
- Set up Environment Variables on Railway:
DISCORD_TOKEN=your-discord-bot-token-hereGROK_API_KEY=your-grok-api-key-here
- Railway will automatically deploy your bot and it will be up and running.
Feel free to fork the repository, make changes, and submit pull requests. Contributions are always welcome!
- JDA (Java Discord API) for providing the framework to interact with Discord.
- Spring Boot for the easy setup of the bot.
- Grok API for AI-related functionalities.
Made with ❤️ by sparshsinghal885