AstralBot
AstralBot represents a unique combination of a Minecraft mod and a Discord bot integrated into a single package. Originally developed for the official server of the Create: Astral modpack, this project features cross-platform implementation, making it available for use on any servers.
Key Features
The main advantage of AstralBot is its ease of use for beginner server administrators while maintaining extensive capabilities for experienced users.
Account Linking - integration of Discord and Minecraft accounts with optional binding requirement for whitelist access
Chat Synchronization - mutual message transfer between in-game and Discord chats with the possibility of using webhooks for improved readability
FAQ Commands - frequently asked questions system based on Markdown files, updatable without server restart
Technical Requirements
For the mod to function, the following are required:
- Kotlin implementation for the selected platform (Kotlin For Forge or Fabric Language Kotlin)
- (Neo-)Forge configuration API (included in Neo/Forge, requires separate installation for Fabric)
Technical Implementation
The project is built on modern technologies:
- JDA library for interaction with Discord API
- Kotlin language for enhanced development experience
- JetBrains Exposed for database operations
Configuration Settings
The following configuration parameters are available:
Mandatory Account Binding - enabling the requirement of account linking for whitelist access (default: disabled)
Chat Synchronization with User Imitation - several options for message display:
- No imitation (bot sends messages under its own name)
- Minecraft user imitation (uses game nicknames and avatars)
- Discord user imitation (requires mandatory account binding)
By default, Minecraft user imitation is used when webhooks are available.
FAQ Management via Commands - ability to edit FAQ through command interface (default: disabled)
Database Connection - uses SQLite database by default
Current Development Status
- ✅ Whitelist system
- ⚠️ FAQ Commands
- ✅ Reading Markdown files
- ✅ Updating suggestions without restart
- ❌ Management via commands
- ✅ Chat Synchronization
- ✅ Minecraft → Discord
- ✅ Discord → Minecraft
- ✅ User imitation (Minecraft or Discord avatars)
Setup and Launch
Public bot instances are not available. To use it, create a new application in Discord Developer Portal and configure it with three privileged intents: PRESENCE, SERVER MEMBERS and MESSAGE CONTENT.
The bot token must be stored in the DISCORD_TOKEN environment variable or in the configuration file under the token key. Example setup for Unix systems:
export DISCORD_TOKEN=<your token>
java ... # server startup command
After server startup, generate an OAuth2 URL with bot and applications.commands permissions in Discord Developer Portal and use it to add the bot to your server.
To use user imitation, which improves the readability of synchronized chat, the bot will attempt to create a webhook in the specified channel. This requires permission to manage webhooks. Alternatively, you can create a webhook manually and specify it in the webhook.url option of the mod configuration.