Skip to content

Feature: Configurable server/channel/role setup #52

@adrunkhuman

Description

@adrunkhuman

Current State (Hacky)

Hardcoded Admin Roles

Admin check is duplicated in 3 places with hardcoded role names:

admin_roles = {"admin", "typer-admin"}

Locations:

  • user_commands.py:282
  • admin_commands.py:28
  • bot.py:297

Problem: Server admins must create roles named exactly "Admin" or "typer-admin" (case-insensitive). No flexibility for existing server structures.

Implicit Channel Setup

Bot posts wherever commands are run:

  • Fixture announcements go to the channel where /admin fixture create was executed
  • Results post to wherever /admin results calculate runs
  • No dedicated prediction/results channels

Problem: Admins must remember to run commands in the "correct" channel. Easy to accidentally spam the wrong channel.

No Server-Specific Configuration

All servers using the bot share the same hardcoded settings. No per-server customization.

Desired State (Configurable)

Server Admin Configuration

Server admins should be able to configure via commands:

Roles:

  • /config admin-role set @RoleName - Which role can use admin commands
  • /config admin-role add @AnotherRole - Multiple admin roles allowed
  • /config admin-role list - See current admin roles

Channels:

  • /config channel predictions #predictions - Where fixtures are announced
  • /config channel results #results - Where results are posted
  • /config channel general #football-chat - Default channel for other messages

Other Settings:

  • /config timezone Europe/London - Override server timezone
  • /config language pl - Future: i18n support

Migration Path

For existing deployments:

  1. Check if config table exists
  2. If not: create with defaults matching current hardcoded values
  3. Existing servers continue working unchanged

Permission Requirements

Bot needs:

  • Manage Roles (to verify admin roles)
  • Manage Channels (to read/write in configured channels)
  • Existing: Send Messages, Read Message History, Add Reactions

Open Questions

  1. Storage: New server_config table keyed by guild_id? Or use Discord's native command permissions?
  2. UI: Discord slash command permissions vs our own role check - which wins?
  3. Setup flow: Should bot DM server owner on first join with setup instructions?
  4. Multi-guild: Bot currently designed for single server - should we embrace multi-guild support?

Priority

Medium - Current hardcoded setup works but is brittle. Configurable setup enables broader adoption.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions