Skip to content

e-psi-lon/ParalyaBot

Repository files navigation

ParalyaBot

License: AGPL-3.0 JDK Discord

A Discord bot for the Paralya Discord server, built with Kotlin and KordEx.

Overview

ParalyaBot is a modular Discord bot designed to facilitate community management and games for the Paralya community. The current implementation includes a Werewolf (Loup-Garou) game module directly integrated in the core bot. Once the plugin system is totally implemented, this game module, along with any potential other, will be moved to a dedicated plugin.

Support

This bot is designed and supported only for use on the Paralya Discord server (ID: 883659215590277181). To get support, you can:

You are free to self-host under the terms of the AGPL-3.0 license, but functionality and support may not be guaranteed outside that context.

Project Structure

paralya-bot/
├── build.gradle.kts          # Root build configuration
├── settings.gradle.kts       # Project settings
├── src/                      # Root module sources
│   └── main/
│       ├── kotlin/           # Main application code
│       └── resources/        # Root resources
├── common/                   # Common utilities module
│   ├── src/
│   │   ├── main/kotlin/      # Shared code
│   │   └── resources/        # Common resources
│   └── build.gradle.kts      # Common module build config
├── lg/                       # Werewolf (Loup-Garou) game module
│   ├── src/
│   │   └── main/kotlin/      # Game implementation
│   └── build.gradle.kts      # LG module build config
└── games/                    # Folder for installed game plugins

Key Features

  • Modular architecture for easy extension
  • Werewolf game with full role support and game cycle management
  • Command-based interface for easy interaction
  • Internationalization support
  • Configuration through HOCON files

Requirements

  • JDK 21 or newer
  • Gradle (wrapper included)
  • Discord Bot Token
  • Discord server with appropriate permissions

Installation

For Users

  • If you are an admin of the Paralya Discord server, you can directly ask me on Discord to get a pre-built JAR file.
  • If you want to self-host for your own server, please follow the Developers instruction below to set up the bot. You'll need to edit some values and to have some basic knowledge of Kotlin and Gradle as well as a Discord bot

For Developers

  1. Clone the repository:
    git clone https://github.com/paralya/paralyabot.git
    cd paralyabot
  2. Create a config.conf file in the project root (see the Configuration section)
  3. Build and run as described in the Building section

Setup and Configuration

Create a config.conf file with the following structure:

bot {
  token = "YOUR_DISCORD_BOT_TOKEN"
  admins = [YOUR_DISCORD_USER_ID, ANOTHER_ADMIN_USER_ID]
  dmLogChannelId = DM_LOG_CHANNEL_ID
  paralyaId = PARALYA_SERVER_ID
}

games {
  // LG is an example, other games can be added similarly
  lg {
    rolesCategory = ROLES_CATEGORY_ID
    mainCategory = MAIN_CATEGORY_ID
    aliveRole = ALIVE_ROLE_ID
    deadRole = DEAD_ROLE_ID
  }
}

Discord Bot Setup

  1. Go to the Discord Developer Portal
  2. Create a new application
  3. Navigate to the "Bot" section and create a bot
  4. Enable the necessary "Privileged Gateway Intents" (Message Content, Server Members, Presence)
  5. Copy the bot token to your config.conf file
  6. Use the OAuth2 URL Generator to invite the bot to your server with appropriate permissions

Building

Build the entire project using Gradle:

./gradlew build

Build the deployable JAR:

./gradlew shadowJar

Export a plugin as a ready-to-use ZIP file for your games directory:

./gradlew :plugin-name:distZip

Running

Run the bot using:

java -jar build/libs/paralya-bot-$version.jar

For development, you can also run directly from Gradle:

./gradlew run

Game Modules

Werewolf (Loup-Garou)

A complete implementation of the Werewolf game for Discord. Features include:

  • Day/night cycle management
  • Role-based gameplay
  • Voting system
  • Special abilities for different roles
  • Webhook-based anonymous messaging

See the LG module README for more details on the Werewolf game implementation.

Development

Adding New Games

The complete instructions for adding a new game module is available in the common module README. You'll find a step-by-step guide on how to create a new game configuration and implement the game logic.

Troubleshooting

Common Issues

  • Configuration errors: Verify your config.conf file has the correct format and valid IDs

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) — see the LICENSE file for details.

About

The source of the Paralya's Discord bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published