Skip to content

ComputerEndProgram/STFC-Verifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Veil Security Bot - Rank-Based Verification

A Discord bot for STFC (Star Trek: Fleet Command) player verification with alliance rank-based role assignment.

Features

  • Player Verification: Verify STFC players via stfc.pro or stfc.wtf
  • Rank-Based Role Assignment:
    • Base ranks (Agent/Operative/Premier) → Base member role (assigned immediately)
    • Leadership ranks (Commodore/Admiral) → Respective roles (after admin confirmation)
    • Optional verification role (if configured)
  • Periodic Updates: Automatically checks for rank changes every 24 hours
  • Admin Confirmation: Leadership rank promotions require admin approval via buttons
  • Screenshot Logging: Verification attempts are logged to Discord

Setup

1. Install Dependencies

pip install -r requirements.txt

2. Configure Environment

Copy .env.example to .env and fill in your values:

cp .env.example .env

Edit .env with:

  • DISCORD_TOKEN: Your Discord bot token
  • GUILD_ID: Your Discord server ID
  • MEMBER_ROLE_ID: ID of the base member role (for Agent/Operative/Premier)
  • COMMODORE_ROLE_ID: ID of the Commodore role
  • ADMIRAL_ROLE_ID: ID of the Admiral role
  • ADMIN_ROLE_ID: ID of admin role (for confirmations) - optional
  • VERIFY_ROLE_ID: ID of the verification role - optional
  • VERIFY_CHANNEL_ID: Channel where verification command can be used
  • LOG_CHANNEL_ID: Channel for logging verifications and confirmations

3. Discord Setup

Create these roles in your Discord server:

  • Member (or similar base role name)
  • Commodore
  • Admiral
  • Verification (optional)
  • Admin or similar (optional, for pinging admins)

4. Run the Bot

python bot.py

Commands

/verify_stfc

Verify a player's STFC account.

Arguments:

  • player_link: stfc.pro/stfc.wtf URL or player ID (e.g., https://stfc.pro/players/2659122580)
  • screenshot: Screenshot of the player's STFC profile

Results:

  • Sets Discord nickname: [SERVER] ALLIANCE - USERNAME
  • Assigns member role (for base ranks) immediately
  • For leadership ranks: posts confirmation request to admin
  • Logs verification to LOG_CHANNEL with screenshot

How It Works

Rank System

Rank Tier Role Assignment Confirmation Needed
Agent Base Immediate ✓ ❌ No
Operative Base Immediate ✓ ❌ No
Premier Base Immediate ✓ ❌ No
Commodore Leadership After Admin Approval ✅ Yes
Admiral Leadership After Admin Approval ✅ Yes

Verification Command Flow

  1. User runs /verify_stfc with player link and screenshot
  2. Bot fetches player data from stfc.pro (including rank)
  3. Bot verifies player and sets nickname to [SERVER] ALLIANCE - USERNAME
  4. For base ranks (Agent/Operative/Premier): Member role assigned immediately ✓
  5. For leadership ranks (Commodore/Admiral): Admin gets confirmation message in LOG_CHANNEL with Accept/Reject buttons
  6. Admin clicks button to approve or deny the rank
  7. Verification logged to LOG_CHANNEL with player info

Periodic Updates (every 24 hours)

  1. Bot fetches all stored player links
  2. For each player:
    • Updates player data from stfc.pro
    • Detects any rank changes
    • If rank changed: Posts confirmation request to LOG_CHANNEL
    • Admin can accept/reject the rank change

Configuration

Environment Variables

Variable Required Description
DISCORD_TOKEN Yes Discord bot token
GUILD_ID Yes Discord server ID
MEMBER_ROLE_ID Yes ID of base member role
COMMODORE_ROLE_ID Yes ID of Commodore role
ADMIRAL_ROLE_ID Yes ID of Admiral role
VERIFY_ROLE_ID No ID of verification role
ADMIN_ROLE_ID No ID of admin role (for pinging)
VERIFY_CHANNEL_ID Yes Channel where verification command works
LOG_CHANNEL_ID Yes Channel for logging and confirmations
UPDATE_CHECK_HOURS No Hours between periodic updates (default: 24)
DB_PATH No Path to SQLite database (default: stfc_players.db)
DEBUG No Enable debug logging (0 or 1, default: 0)

Database

The bot stores player data in SQLite (stfc_players.db). Stored information includes:

  • Discord user ID
  • STFC player ID and link
  • Username, level, server
  • Alliance tag
  • Alliance rank (Agent, Operative, Premier, Commodore, Admiral)
  • Verification status and timestamp

Database is automatically created on first run.

Logging

Logs are output to stdout. Enable debug logging by setting DEBUG=1 in .env.

Verification events are logged to LOG_CHANNEL with:

  • Player name and rank
  • Server and alliance information
  • Verification screenshot
  • Admin confirmation buttons (for leadership ranks)

Version History

v3.0 (Current):

  • ✅ Switched to rank-based role assignment (Agent/Operative/Premier → Commodore/Admiral)
  • ✅ Added admin confirmation flow for leadership ranks
  • ✅ Detects rank changes during periodic updates
  • ✅ Ranks extracted from stfc.pro player profiles

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages