Skip to content

Reference file structure #44

@KDwevedi

Description

@KDwevedi

Version 1 of a scalable file structure:

my_discord_bot/
│
├── cogs/                       # Directory for all your cogs
│   ├── listeners/              # Cogs specifically for event listeners
│   │   ├── __init__.py
│   │   ├── member_events.py    # Example: Handling member join/leave events
│   │   └── message_events.py   # Example: Handling message events
│   │
│   ├── commands/               # Cogs for command handling
│   │   ├── __init__.py
│   │   ├── moderation.py       # Example: Moderation related commands
│   │   └── fun_commands.py     # Example: Fun or miscellaneous commands
│   │
├── entities/                   # Directory for custom entity classes
│   ├── __init__.py
│   ├── user.py                 # Example: Custom user entity
│   └── guild.py                # Example: Custom guild entity
│
├── interfaces/                 # Interfaces for external services
│   ├── __init__.py
│   ├── supabase_interface.py   # Interface class for Supabase
│   └── other_service.py        # Other external service interfaces
│
├── utils/                      # Utility functions and classes
│   ├── __init__.py
│   ├── helpers.py              # Helper functions
│   └── logger.py               # Logging utility
│
├── config/                     # Configuration files
│   ├── __init__.py
│   ├── config.py               # General bot configuration
│   └── secrets.py              # Secrets like tokens, passwords, etc.
│
├── tests/                      # Unit tests for your bot
│   ├── __init__.py
│   ├── test_commands.py        # Test cases for commands
│   └── test_listeners.py       # Test cases for listeners
│
├── .env                        # Environment variables file
├── main.py                     # Main bot file
├── requirements.txt            # List of dependencies
└── README.md                   # Project documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions