This document outlines the standards contributors should follow when creating or updating cogs for the Tux Discord bot. Following these guidelines ensures consistent code quality, maintainability, and ease of use across the bot's functionality.
## File Structure & Naming
- Place your cogs in the `tux/cogs` directory, organized by functionality (e.g., `admin`, `utility`, `moderation`).
- Name your cog file descriptively based on its primary function (e.g., `info.py` for information-related commands).
- Use lowercase with underscores (`_`) for file names.
## Cog Class
- Each cog should inherit from `commands.Cog`.
- Initialize your cog class with a constructor accepting a `bot` instance and storing it as an instance variable.
- Clearly comment your code to describe the functionality and any nuances or important details.
### Example:
```python
from discord.ext import commands
class MyCog(commands.Cog):
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
```
## Commands
- Use the `@commands.command()` decorator for prefix commands.
- Review existing cogs for examples and inspiration.
- Code readability, consistency, and simplicity are key.
- Test your changes thoroughly before submitting a pull request.
Thank you for contributing to Tux! Your efforts help make Tux a valuable tool for our community. If you have any questions or need further clarification on these standards, please reach out to the project maintainers.