Alliances
Alliance management system for the Dark War Survival community. Commands grouped under the /alliance prefix.
The alliance system uses ranks R1–R5:
- R5 — Leader (one per alliance, full permissions)
- R4 — Officer (inviting, kicking R1–R3)
- R3–R1 — Members (no management permissions)
Commands
/alliance create
Creates a new alliance with a given name, tag, and color. Automatically creates a Discord role in the format [TAG] Name.
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Alliance name (2–32 characters: letters, numbers, spaces, hyphens) |
| tag | string | Yes | Short tag (1–5 alphanumeric characters, e.g., KNS) |
| color | string | No | Role color in hex format (default #5865F2) |
Permissions: Server Administrator, Management Roles, or R5 in any alliance
Example: /alliance create name:Knights tag:KNS color:#E74C3C
Success: Creates alliance, Discord role [KNS] Knights, adds creator as R5, assigns role, optionally adds to Reaction Roles
Errors:
- Missing permissions
- Invalid name (disallowed characters or length)
- Invalid tag (not 1–5 alphanumeric)
- Invalid color format (not
#XXXXXX) - Alliance limit reached (default 10)
- Alliance with this name already exists
- Tag already taken by another alliance
- Bot cannot create role (missing
manage_rolespermission)
User enters KNS, the system stores it as [KNS] and creates role [KNS] Knights.
/alliance delete
Deletes an alliance — removes the database record, removes the Discord role from all members, cleans up associations.
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Alliance name to delete |
Permissions: Server Administrator (only)
Example: /alliance delete name:Knights
Success: Deletes alliance, role, members from database, updates Reaction Roles
Errors:
- Missing administrator permissions
- Alliance not found
- Database error
/alliance invite
Invites a user to your alliance. Adds them as R1 and assigns the Discord role.
| Parameter | Type | Required | Description |
|---|---|---|---|
| member | Member | Yes | User to invite |
Permissions: R4 or R5 in your alliance
Example: /alliance invite member:@NewPlayer
Success: Adds member as R1, assigns alliance role
Errors:
- You're not in an alliance
- Your rank is below R4
- Target is already in your alliance
- Target is in another alliance (must leave first)
- Alliance has reached member limit (default 50)
/alliance kick
Kicks a member from your alliance. Removes them from the database and removes the Discord role.
| Parameter | Type | Required | Description |
|---|---|---|---|
| member | Member | Yes | Member to kick |
Permissions: R4 or R5 in your alliance
Example: /alliance kick member:@InactivePlayer
Success: Removes member, removes role
Errors:
- You're not in an alliance
- Your rank is below R4
- Target is not in your alliance
- R4 trying to kick R4 or higher (not allowed)
- Trying to kick yourself (use
/alliance leave)
R4 can kick only members with rank R1–R3. R5 can kick everyone except themselves.
/alliance leave
Leaves your current alliance. Removes the Discord role.
| Parameter | Type | Required | Description |
|---|---|---|---|
| (none) | — | — | — |
Permissions: Any alliance member (except R5)
Example: /alliance leave
Success: Removes you from the alliance, removes role
Errors:
- You're not in an alliance
- You're R5 — must first transfer leadership (
/alliance transfer)
/alliance promote
Promotes an alliance member by one rank (max to R4).
| Parameter | Type | Required | Description |
|---|---|---|---|
| member | Member | Yes | Member to promote |
Permissions: R5 (leader only)
Example: /alliance promote member:@ActivePlayer
Success: Increases rank by 1 (e.g., R2 → R3)
Errors:
- You're not in an alliance
- You don't have R5 rank
- Target is not in your alliance
- Target is already R4 (maximum promotion — R5 can only be transferred)
/alliance demote
Demotes an alliance member by one rank (min R1).
| Parameter | Type | Required | Description |
|---|---|---|---|
| member | Member | Yes | Member to demote |
Permissions: R5 (leader only)
Example: /alliance demote member:@Player
Success: Decreases rank by 1 (e.g., R3 → R2)
Errors:
- You're not in an alliance
- You don't have R5 rank
- Target is not in your alliance
- Target is already R1 (lowest rank)
/alliance transfer
Transfers leadership (R5) to another alliance member. You become R4.
| Parameter | Type | Required | Description |
|---|---|---|---|
| member | Member | Yes | New leader |
Permissions: R5 (current leader only)
Example: /alliance transfer member:@NewLeader
Success: Target → R5, You → R4 (atomic transaction)
Errors:
- You're not in an alliance
- You don't have R5 rank
- Trying to transfer to yourself
- Target is not in your alliance
/alliance info
Displays alliance details: member list grouped by ranks, creation date, role.
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | No | Alliance name (if empty — shows your alliance) |
Permissions: Everyone
Example: /alliance info or /alliance info name:Knights
Success: Embed with alliance data (color, date, role, member list R5→R1)
Errors:
- No name provided and you're not in any alliance
- Alliance not found
/alliance list
Displays a list of all active alliances on the server.
| Parameter | Type | Required | Description |
|---|---|---|---|
| (none) | — | — | — |
Permissions: Everyone
Example: /alliance list
Success: Embed with alliance list (name, member count, leader)
Errors:
- No alliances on the server (info message)
Automatic Behaviors
Auto-succession
When the leader (R5) leaves the server:
- If other members exist → highest-ranked (then longest in alliance) automatically becomes R5
- If they were the only member → alliance is marked as inactive
Reaction Roles Integration
If auto_reaction_role is enabled in the configuration:
- Creating an alliance → role added to the Reaction Roles panel
- Deleting an alliance → role removed from the panel
- Adding a role via Reaction Role → automatic join to alliance as R1
- Removing a role → automatic leave from alliance
- Attempting to join a second alliance via Reaction Role → role is automatically removed (rejection)
Leaving the Server
When an alliance member leaves the server, they are automatically removed from the alliance. If they were R5, auto-succession is triggered.
Configuration
| Option | Description | Default Value |
|---|---|---|
max_alliances | Maximum number of alliances per server | 10 |
max_members | Maximum number of members per alliance | 50 |
auto_reaction_role | Integration with Reaction Roles panel | false |
reaction_role_index | RR panel index to sync with | null (first) |
management_roles | Roles that can create/manage alliances | none |