Discord Admin Plugin for Rising World

Version 3.7.0

Table of Contents

Introduction

The Discord Admin Plugin is a comprehensive integration between Rising World and Discord, providing advanced administration tools, player management, chat relay, and server monitoring capabilities. This plugin enables server admins to manage their Rising World server directly from Discord, streamlining administration and enhancing the player community experience.

Key Features

Installation

  1. Download the Discord Admin Plugin JAR file
  2. Place the JAR file in your Rising World server's plugins directory
  3. Start (or restart) your server to generate configuration files
  4. Configure the plugin by editing the config.properties file in the plugin's directory
  5. Configure your Discord bot and add it to your server (see Discord Bot Setup)
  6. Restart your server to apply all settings

Note: Upon first start, the plugin will create default configuration files in a folder named plugins/Discord Admin Integration in your Rising World server directory.

Discord Bot Setup

Before using the plugin, you need to create a Discord bot and invite it to your server:

Creating a Discord Bot

  1. Go to the Discord Developer Portal
  2. Click on "New Application" and give it a name (e.g., "Rising World Admin")
  3. Go to the "Bot" tab and click "Add Bot"
  4. Under the TOKEN section, click "Copy" to copy your bot token
  5. Paste this token in your config.properties file's discord.token setting
  6. Under "Privileged Gateway Intents," enable:
    • PRESENCE INTENT
    • SERVER MEMBERS INTENT
    • MESSAGE CONTENT INTENT

Inviting the Bot to Your Server

  1. Still in the Developer Portal, go to the "OAuth2" tab, then "URL Generator"
  2. Under "Scopes," select "bot" and "applications.commands"
  3. Under "Bot Permissions," select:
    • Manage Server
    • Manage Roles
    • Manage Channels
    • Kick Members
    • Ban Members
    • Create Instant Invite
    • Manage Messages
    • Read Message History
    • Send Messages
    • Embed Links
    • Attach Files
    • Read Messages/View Channels
  4. Copy the generated URL at the bottom of the page
  5. Open this URL in your browser and select your Discord server to invite the bot

Setting Up Admin Channel

  1. Create a channel in your Discord server for administration (e.g., #rw-admin)
  2. Set appropriate permissions to restrict access to admins only
  3. Right-click on the channel and select "Copy ID" (ensure Developer Mode is enabled in Discord settings)
  4. Paste this ID in your config.properties file's discord.admin.channel setting

Tip: To enable Developer Mode in Discord, go to User Settings > Advanced > Developer Mode.

Configuration

The main configuration file is config.properties located in your plugin's directory. Below are the available settings, organized by category.

Discord Bot Configuration

Setting Description Default Value
discord.token Your Discord bot token (required) Empty
discord.admin.channel Discord channel ID for admin communications (required) Empty
discord.bot.activity Bot activity status shown in Discord Watching Rising World
discord.startup.notification Send notification when plugin starts (true/false) true
discord.error.notification.enabled Send notifications about errors (true/false) true

Chat Relay Settings

Setting Description Default Value
chat.relay.game_to_discord Enable chat relay from game to Discord true
chat.relay.discord_to_game Enable chat relay from Discord to game true
chat.format.discord_to_game Format for messages sent from Discord to game. Placeholders: %author%, %message% [Discord] %author%: %message%
chat.format.game_to_discord Format for messages sent from game to Discord. Placeholders: %player%, %message% [Game] %player%: %message%

Chat Filter Settings

Setting Description Default Value
chat.filter.enabled Enable the chat filter (true/false) false
chat.filter.words Comma-separated list of words to filter from chat badword1,badword2

Server Status Display Settings

Setting Description Default Value
status.updates.enabled Enable automatic status updates true
status.updates.interval Status update interval in minutes 10
status.embed.online.color Color for online status in hex format #00FF00
status.embed.offline.color Color for offline status in hex format #FF0000
status.embed.restart.color Color for restart status in hex format #FFA500
status.embed.max_players Maximum number of players to display in status message 15
status.embed.show_admin Show admin status in player list (true/false) false
status.embed.show_player_time Show player connection time in player list (true/false) false
status.embed.recreate_on_startup Always recreate status message on startup instead of reusing existing one (true/false) false

Automatic Restart Configuration

Setting Description Default Value
restart.daily.enabled Enable daily automatic restarts (true/false) true
restart.daily.time Daily restart time in 24-hour format (HH:MM) 04:00
restart.timezone Timezone for restart scheduling (e.g. UTC, America/New_York) System default
restart.countdown.minutes Warning countdown in minutes before restart 30
restart.warning.times Warning times in minutes (comma-separated) 20,15,10,5,3,1
restart.broadcast.prefix Prefix for restart warning messages ⚠️ **SERVER RESTART**
restart.pre_shutdown.backup Create backup before restart (true/false) true
restart.immediate_action Action to take when immediate restart is triggered: "lock" or "kick" lock
restart.command Server restart command (OS specific) OS specific default

Note: The restart.command setting is crucial for proper restart functionality. For Linux servers, a bash script is typically used. For Windows, a batch file might be needed.

Example restart commands:

Linux:

restart.command=bash -c "./rwserver restart > /Home/RWserver/log/command_output.log 2>&1 &"

Windows:

restart.command=start cmd /c start_server.bat

Discord Message Management

Setting Description Default Value
discord.message.delete.delay Delay (in seconds) before deleting messages 300
discord.message.delete.mode Message deletion mode: "always", "on_restart", or "never" always

Player Management

Setting Description Default Value
player.connection.log.enabled Enable logging of player connections (true/false) true
player.connection.log.directory Directory for player connection logs player_connections
player.rejoin.time.track Track time between player rejoins (true/false) true
player.history.enabled Enable player history tracking (true/false) true
player.history.max_notes Maximum number of notes per player 50
player.welcome.message.enabled Enable welcome message for new players (true/false) true
player.welcome.message Welcome message text (placeholder: %player% Welcome to the server, %player%!

Message Format Settings

Setting Description Default Value
message.join.format Player join message format (placeholder: %player%,%playercount%,%totalplayers%) 🟢 **%player% joined the server**
message.leave.format Player leave message format (placeholder: %player%,%playercount%, %totalplayers%) 🔴 **%player% left the server**

Discord Invite Management

Setting Description Default Value
invite.enabled Master switch to enable/disable Discord invites completely true
invite.auto_assign_role Automatically assign roles based on invite used true
invite.tracking_window Tracking window (in seconds) for invite usage detection 15
invite.auto_send_on_join Enable automatic Discord invite on player join (true/false) true
invite.welcome_message Discord welcome message for new members (placeholder: %user%) Welcome, %user%! Join our game server with /link
invite.use_dynamic Use dynamic invites with expiry (true) or permanent invites (false) false
invite.dynamic.max_uses Default maximum uses for dynamic invites (0 for unlimited) 1
invite.dynamic.expiration_hours Default expiration hours for dynamic invites (0 for never) 24
invite.dynamic.role_id Role ID to assign for dynamic invites (required when dynamic invites enabled) Empty

Note: The dynamic invite system is a new feature in version 3.7. It allows for creating temporary invites that expire after a certain time or number of uses, with automatic role assignment.

Backup Configuration

Setting Description Default Value
backup.directory Directory for backups backups
backup.max_count Maximum number of backups to keep 10

Plugin Logging

Setting Description Default Value
logs.max_files Maximum number of log files to keep 30
logs.directory Directory for log files logs
logs.level Log level (DEBUG, INFO, WARNING, SEVERE, CRITICAL) INFO
logs.console.debug Enable console output for debug logs (true/false) false

Discord Commands

The plugin adds numerous slash commands to Discord. Below is a complete reference.

Server Information Commands

/players

Lists all online players on the server.

Permissions: Available to everyone by default

/refresh_status

Refreshes the server status message.

Permissions: ADMINISTRATOR, MANAGE_SERVER

Moderation Commands

/kick

Kicks a player from the server.

Parameters:

Permissions: KICK_MEMBERS, ADMINISTRATOR

/ban

Bans a player from the server.

Parameters:

Permissions: BAN_MEMBERS, ADMINISTRATOR

/unban

Unbans a player from the server.

Parameters:

Permissions: BAN_MEMBERS, ADMINISTRATOR

/teleport

Teleports a player to coordinates or another player.

Parameters:

Permissions: ADMINISTRATOR

Note: You must provide either coordinates (x, y, z) or a target player.

/broadcast

Broadcasts a message to all players on the server.

Parameters:

Permissions: MANAGE_SERVER, ADMINISTRATOR

Server Management Commands

/restart

Initiates a server restart with the configured countdown.

Permissions: MANAGE_SERVER, ADMINISTRATOR

/restart_enable

Enables or disables automatic server restarts.

Parameters:

Permissions: ADMINISTRATOR

/restart_time

Sets the daily restart time.

Parameters:

Permissions: ADMINISTRATOR

/restart_timezone

Sets the timezone for restarts.

Parameters:

Permissions: ADMINISTRATOR

/list_timezones

Lists available timezones for restart configuration.

Parameters:

Permissions: ADMINISTRATOR

/reload_config

Reloads the plugin's configuration files.

Permissions: ADMINISTRATOR

Player Account Management

/link

Links your Discord account to your game account.

Parameters:

Permissions: Available to everyone by default

/promote

Promotes a player to admin status.

Parameters:

Permissions: ADMINISTRATOR

/demote

Demotes a player from admin status.

Parameters:

Permissions: ADMINISTRATOR

Player History Commands

/warn

Adds a warning to a player's history.

Parameters:

Permissions: KICK_MEMBERS, ADMINISTRATOR

/note

Adds a note to a player's history.

Parameters:

Permissions: KICK_MEMBERS, ADMINISTRATOR

/history

View a player's history (warnings, notes, moderation actions).

Parameters:

Permissions: KICK_MEMBERS, ADMINISTRATOR

/delete_note

Delete a note from a player's history.

Parameters:

Permissions: ADMINISTRATOR

Discord Invite Management

/reset_discord_connection

Resets Discord connection status for a player.

Parameters:

Permissions: ADMINISTRATOR

/send_discord_invite

Sends a Discord invite to a specific player.

Parameters:

Permissions: ADMINISTRATOR

/toggle_discord_invites

Enable or disable Discord invites completely.

Parameters:

Permissions: ADMINISTRATOR

/create_invite

Creates an invite link that assigns a role.

Parameters:

Permissions: CREATE_INSTANT_INVITE, ADMINISTRATOR

/create_dynamic_invite

Creates a dynamic invite with expiry.

Parameters:

Permissions: CREATE_INSTANT_INVITE, ADMINISTRATOR

/link_invite

Links an existing invite with a role.

Parameters:

Permissions: MANAGE_CHANNEL, ADMINISTRATOR

/delete_invite

Deletes a role invite.

Parameters:

Permissions: MANAGE_CHANNEL, ADMINISTRATOR

/list_invites

Lists all role invites.

Permissions: MANAGE_CHANNEL, ADMINISTRATOR

/set_default_invite

Sets the default Discord invite for automatic player invites.

Parameters:

Permissions: ADMINISTRATOR

/set_invite_type

Sets whether to use dynamic or permanent invites.

Parameters:

Permissions: ADMINISTRATOR

Feature Guides

Setting Up Discord Invites and Role Management

The Discord Admin Plugin offers powerful tools for managing Discord invites and automatically assigning roles to players who join your Discord server. Here's a comprehensive guide to setting this up.

Prerequisites

Basic Setup

  1. Enable invites in configuration:

    Make sure the following settings are enabled in your config.properties:

    invite.enabled=true
    invite.auto_assign_role=true
    invite.auto_send_on_join=true
  2. Create a role for players:

    In your Discord server, create a role for players (e.g., "Rising World Player").

    Right-click on the role and select "Copy ID" (make sure Developer Mode is enabled in Discord).

  3. Create an invite with role assignment:

    Use the command /create_invite in Discord:

    /create_invite channel:YOUR_CHANNEL_ID role:YOUR_ROLE_ID

    Replace YOUR_CHANNEL_ID with the ID of the channel you want the invite to direct to (right-click channel, "Copy ID").

    Replace YOUR_ROLE_ID with the ID of the role you copied earlier.

  4. Set as default invite:

    Once the invite is created, you'll get a response with the invite code. Use this to set it as the default:

    /set_default_invite invite_code:YOUR_INVITE_CODE

    This invite will now be automatically sent to players when they join your server.

Using Dynamic Invites (New in v3.7)

Dynamic invites are temporary invites that expire after a set time or number of uses. This can provide better security and tracking.

  1. Enable dynamic invites in configuration:

    Update your config.properties with:

    invite.use_dynamic=true
    invite.dynamic.max_uses=1
    invite.dynamic.expiration_hours=24
    invite.dynamic.role_id=YOUR_ROLE_ID

    Replace YOUR_ROLE_ID with the Discord role ID for players.

  2. Switch to dynamic invites in Discord:

    /set_invite_type type:dynamic
  3. Test the system:

    You can manually send a dynamic invite to a player with:

    /send_discord_invite player:PlayerName dynamic:true role:YOUR_ROLE_ID

Advanced Role Management

You can create multiple invites with different roles for different player types:

  1. Create different roles in Discord:

    Examples: "RW-VIP", "RW-Donor", "RW-Regular", etc.

  2. Create multiple invites with different roles:

    /create_invite channel:CHANNEL_ID role:VIP_ROLE_ID
    /create_invite channel:CHANNEL_ID role:DONOR_ROLE_ID
    /create_invite channel:CHANNEL_ID role:REGULAR_ROLE_ID
  3. Send specific invites to specific players:

    /send_discord_invite player:VIPPlayerName invite_code:VIP_INVITE_CODE

Managing Invites

Security Tip: Consider using dynamic invites with a single-use limit for better security. This prevents invite links from being shared and ensures each player gets a unique invite.

Configuring the Chat Filter

The Discord Admin Plugin includes a chat filter system that can automatically censor inappropriate words in both in-game and Discord chat. Here's how to set it up.

Basic Setup

  1. Enable the chat filter:

    In your config.properties file, set:

    chat.filter.enabled=true
  2. Define filtered words:

    Add a comma-separated list of words to filter:

    chat.filter.words=badword1,badword2,badword3

    The filter is case-insensitive, so you don't need to include variations.

  3. Save and restart:

    Save your configuration file and restart the server to apply the changes.

How the Filter Works

The chat filter has several advanced features:

Testing and Maintenance

To effectively maintain your chat filter:

Note: The chat filter will only affect new messages; it won't retroactively filter existing messages in Discord.

Using Player History and Notes

The player history system allows server administrators to keep track of player behavior, warnings, and notes. This is especially useful for moderation and tracking problematic players.

Setting Up Player History

  1. Enable player history:

    In your config.properties, ensure these settings are enabled:

    player.history.enabled=true
    player.history.max_notes=50
  2. Restart your server:

    This will create the necessary directories and files for the history system.

Adding Player Notes

There are two main types of entries you can add to a player's history:

  1. Warnings:

    Warnings are formal notifications to players about rule violations. To add a warning:

    /warn player:PlayerName reason:Reason for warning

    When you add a warning, the player will be notified in-game with a message.

  2. Notes:

    Notes are staff-only comments about a player. To add a note:

    /note player:PlayerName note:This is a staff note about the player

    Notes are not visible to the player.

Viewing Player History

To view a player's complete history:

/history player:PlayerName

This will show:

Managing Player Notes

To delete a note from a player's history:

  1. First view the player's history to get the note ID: /history player:PlayerName
  2. Delete the specific note: /delete_note player:PlayerName note_id:NOTE_ID

Player Warning Notification

When a player connects to the server, if they have any warnings, they will be informed of the number of warnings on their record.

Tip: Player history is stored in JSON files in the player_history directory inside your plugin folder. These can be backed up if needed.

Setting Up Automated Restarts

Automated server restarts can help maintain server performance and stability. The Discord Admin Plugin provides a robust system for scheduled restarts with appropriate warnings and notifications.

Basic Restart Configuration

  1. Enable automated restarts:

    In your config.properties, set:

    restart.daily.enabled=true
    restart.daily.time=04:00
    restart.timezone=UTC

    This would schedule a daily restart at 4:00 AM UTC.

  2. Configure warning times:

    restart.countdown.minutes=30
    restart.warning.times=20,15,10,5,3,1

    This sets a 30-minute countdown with warnings at 20, 15, 10, 5, 3, and 1 minutes before restart.

  3. Set message format:

    restart.broadcast.prefix=⚠️ **SERVER RESTART**

Setting Up the Restart Command

The most important part of the restart system is the restart command, which is OS-specific:

Linux Example:
restart.command=bash -c "./rwserver restart > /Home/RWserver/log/command_output.log 2>&1 &"

This assumes you have a script called rwserver in the current directory with a restart command.

Windows Example:
restart.command=start cmd /c start_server.bat

This assumes you have a batch file called start_server.bat that handles restarting the server.

Important: The restart command must be properly configured for your specific server environment. Testing is highly recommended to ensure it works correctly.

Timezone Configuration

To list available timezones and set your server's timezone:

  1. Use the command /list_timezones to see available timezone IDs
  2. Set your timezone with /restart_timezone timezone:America/New_York (example)

Manual Restart

To manually trigger a restart with the configured countdown:

/restart

Pre-Restart Actions

Configure what happens right before restart:

Disabling and Re-enabling Restarts

You can temporarily disable and re-enable scheduled restarts:

Changing Restart Time

You can change the daily restart time without editing the config file:

/restart_time time:03:30

This would change the restart time to 3:30 AM in your configured timezone.

Best Practice: Schedule restarts during low-activity hours to minimize disruption to players.

Troubleshooting

Common Issues and Solutions

Discord Bot Not Connecting

Slash Commands Not Appearing

Permission Issues

Chat Relay Not Working

Server Not Restarting Properly

Discord Invites Not Being Sent

Plugin Not Loading at Server Start

Logs and Debugging

To get more detailed information for troubleshooting:

  1. Enable detailed logging:

    In your config.properties, set:

    logs.level=DEBUG
    logs.console.debug=true
  2. Check log files:

    Log files are stored in the logs directory within your plugin folder.

Getting Help

If you're still experiencing issues:

Discord Admin Plugin Manual - Version 3.7.0